Internal renamings in PK
+ an unrelated comment in SSL
diff --git a/include/mbedtls/pk_internal.h b/include/mbedtls/pk_internal.h
index ce91984..f2e0a77 100644
--- a/include/mbedtls/pk_internal.h
+++ b/include/mbedtls/pk_internal.h
@@ -42,7 +42,7 @@
const char *name;
/** Get key size in bits */
- size_t (*get_size)( const void * );
+ size_t (*get_bitlen)( const void * );
/** Tell if the context implements this type (e.g. ECKEY can do ECDSA) */
int (*can_do)( mbedtls_pk_type_t type );
diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h
index 391ce5b..f9b0017 100644
--- a/include/mbedtls/ssl_internal.h
+++ b/include/mbedtls/ssl_internal.h
@@ -265,7 +265,7 @@
*/
const mbedtls_ssl_ciphersuite_t *ciphersuite_info;
/*!< Chosen cipersuite_info */
- unsigned int keylen; /*!< symmetric key length */
+ unsigned int keylen; /*!< symmetric key length (bytes) */
size_t minlen; /*!< min. ciphertext length */
size_t ivlen; /*!< IV length */
size_t fixed_ivlen; /*!< Fixed part of IV (AEAD) */
diff --git a/library/pk.c b/library/pk.c
index 464243e..5a83855 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -332,7 +332,7 @@
if( ctx == NULL || ctx->pk_info == NULL )
return( 0 );
- return( ctx->pk_info->get_size( ctx->pk_ctx ) );
+ return( ctx->pk_info->get_bitlen( ctx->pk_ctx ) );
}
/*
diff --git a/library/pk_wrap.c b/library/pk_wrap.c
index 7012b12..8e584f4 100644
--- a/library/pk_wrap.c
+++ b/library/pk_wrap.c
@@ -64,7 +64,7 @@
type == MBEDTLS_PK_RSASSA_PSS );
}
-static size_t rsa_get_size( const void *ctx )
+static size_t rsa_get_bitlen( const void *ctx )
{
return( 8 * ((const mbedtls_rsa_context *) ctx)->len );
}
@@ -164,7 +164,7 @@
const mbedtls_pk_info_t mbedtls_rsa_info = {
MBEDTLS_PK_RSA,
"RSA",
- rsa_get_size,
+ rsa_get_bitlen,
rsa_can_do,
rsa_verify_wrap,
rsa_sign_wrap,
@@ -188,7 +188,7 @@
type == MBEDTLS_PK_ECDSA );
}
-static size_t eckey_get_size( const void *ctx )
+static size_t eckey_get_bitlen( const void *ctx )
{
return( ((mbedtls_ecp_keypair *) ctx)->grp.pbits );
}
@@ -274,7 +274,7 @@
const mbedtls_pk_info_t mbedtls_eckey_info = {
MBEDTLS_PK_ECKEY,
"EC",
- eckey_get_size,
+ eckey_get_bitlen,
eckey_can_do,
#if defined(MBEDTLS_ECDSA_C)
eckey_verify_wrap,
@@ -303,7 +303,7 @@
const mbedtls_pk_info_t mbedtls_eckeydh_info = {
MBEDTLS_PK_ECKEY_DH,
"EC_DH",
- eckey_get_size, /* Same underlying key structure */
+ eckey_get_bitlen, /* Same underlying key structure */
eckeydh_can_do,
NULL,
NULL,
@@ -366,7 +366,7 @@
const mbedtls_pk_info_t mbedtls_ecdsa_info = {
MBEDTLS_PK_ECDSA,
"ECDSA",
- eckey_get_size, /* Compatible key structures */
+ eckey_get_bitlen, /* Compatible key structures */
ecdsa_can_do,
ecdsa_verify_wrap,
ecdsa_sign_wrap,
@@ -389,7 +389,7 @@
return( type == MBEDTLS_PK_RSA );
}
-static size_t rsa_alt_get_size( const void *ctx )
+static size_t rsa_alt_get_bitlen( const void *ctx )
{
const mbedtls_rsa_alt_context *rsa_alt = (const mbedtls_rsa_alt_context *) ctx;
@@ -434,7 +434,7 @@
size_t sig_len = 0;
int ret;
- if( rsa_alt_get_size( prv ) != rsa_get_size( pub ) )
+ if( rsa_alt_get_bitlen( prv ) != rsa_get_bitlen( pub ) )
return( MBEDTLS_ERR_RSA_KEY_CHECK_FAILED );
memset( hash, 0x2a, sizeof( hash ) );
@@ -475,7 +475,7 @@
const mbedtls_pk_info_t mbedtls_rsa_alt_info = {
MBEDTLS_PK_RSA_ALT,
"RSA-alt",
- rsa_alt_get_size,
+ rsa_alt_get_bitlen,
rsa_alt_can_do,
NULL,
rsa_alt_sign_wrap,