1 // SPDX-License-Identifier: BSD-2-Clause
2 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3  *
4  * LibTomCrypt is a library that provides various cryptographic
5  * algorithms in a highly modular and flexible manner.
6  *
7  * The library is free for all purposes without any express
8  * guarantee it works.
9  */
10 
11 #include "tomcrypt_private.h"
12 
13 /**
14   @file ecc_get_size.c
15   ECC Crypto, Tom St Denis
16 */
17 
18 #ifdef LTC_MECC
19 
20 /**
21   Get the size of an ECC key
22   @param key    The key to get the size of
23   @return The size (octets) of the key or INT_MAX on error
24 */
ecc_get_size(const ecc_key * key)25 int ecc_get_size(const ecc_key *key)
26 {
27    if (key == NULL) {
28       return INT_MAX;
29    }
30    return key->dp.size;
31 }
32 
33 #endif
34 /* ref:         $Format:%D$ */
35 /* git commit:  $Format:%H$ */
36 /* commit time: $Format:%ai$ */
37 
38