From 9a62f2dbfbf7de4b4699bec9e59b1ab5ea093e84 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 20 Aug 2019 14:57:37 +0100 Subject: [PATCH] Fixup: get_bitlen() PK API in TinyCrypt-based ECDSA - Return number of bits and not number of bytes - Return length of private key and not length of public key. --- library/pk_wrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index f8afc1305..92f356a60 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -531,7 +531,7 @@ static int extract_ecdsa_sig( unsigned char **p, const unsigned char *end, static size_t uecc_eckey_get_bitlen( const void *ctx ) { (void) ctx; - return( (size_t) 2 * NUM_ECC_BYTES ); + return( (size_t) ( NUM_ECC_BYTES * 8 ) ); } static int uecc_eckey_can_do( mbedtls_pk_type_t type )