mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Rename relevant global symbols from size to bitlen
Just applying rename.pl with this file: mbedtls_cipher_get_key_size mbedtls_cipher_get_key_bitlen mbedtls_pk_get_size mbedtls_pk_get_bitlen MBEDTLS_BLOWFISH_MIN_KEY MBEDTLS_BLOWFISH_MIN_KEY_BITS MBEDTLS_BLOWFISH_MAX_KEY MBEDTLS_BLOWFISH_MAX_KEY_BITS
This commit is contained in:
@ -178,7 +178,7 @@ int mbedtls_blowfish_setkey( mbedtls_blowfish_context *ctx, const unsigned char
|
||||
unsigned int i, j, k;
|
||||
uint32_t data, datal, datar;
|
||||
|
||||
if( keybits < MBEDTLS_BLOWFISH_MIN_KEY || keybits > MBEDTLS_BLOWFISH_MAX_KEY ||
|
||||
if( keybits < MBEDTLS_BLOWFISH_MIN_KEY_BITS || keybits > MBEDTLS_BLOWFISH_MAX_KEY_BITS ||
|
||||
( keybits % 8 ) )
|
||||
{
|
||||
return( MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH );
|
||||
|
@ -327,7 +327,7 @@ int mbedtls_pk_check_pair( const mbedtls_pk_context *pub, const mbedtls_pk_conte
|
||||
/*
|
||||
* Get key size in bits
|
||||
*/
|
||||
size_t mbedtls_pk_get_size( const mbedtls_pk_context *ctx )
|
||||
size_t mbedtls_pk_get_bitlen( const mbedtls_pk_context *ctx )
|
||||
{
|
||||
if( ctx == NULL || ctx->pk_info == NULL )
|
||||
return( 0 );
|
||||
|
@ -81,7 +81,7 @@ static int ssl_ticket_gen_key( mbedtls_ssl_ticket_context *ctx,
|
||||
|
||||
/* With GCM and CCM, same context can encrypt & decrypt */
|
||||
ret = mbedtls_cipher_setkey( &key->ctx, buf,
|
||||
mbedtls_cipher_get_key_size( &key->ctx ),
|
||||
mbedtls_cipher_get_key_bitlen( &key->ctx ),
|
||||
MBEDTLS_ENCRYPT );
|
||||
|
||||
mbedtls_zeroize( buf, sizeof( buf ) );
|
||||
|
@ -180,7 +180,7 @@ static int x509_profile_check_key( const mbedtls_x509_crt_profile *profile,
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
if( pk_alg == MBEDTLS_PK_RSA || pk_alg == MBEDTLS_PK_RSASSA_PSS )
|
||||
{
|
||||
if( mbedtls_pk_get_size( pk ) >= profile->rsa_min_bitlen )
|
||||
if( mbedtls_pk_get_bitlen( pk ) >= profile->rsa_min_bitlen )
|
||||
return( 0 );
|
||||
|
||||
return( -1 );
|
||||
@ -1438,7 +1438,7 @@ int mbedtls_x509_crt_info( char *buf, size_t size, const char *prefix,
|
||||
}
|
||||
|
||||
ret = mbedtls_snprintf( p, n, "\n%s%-" BC "s: %d bits", prefix, key_size_str,
|
||||
(int) mbedtls_pk_get_size( &crt->pk ) );
|
||||
(int) mbedtls_pk_get_bitlen( &crt->pk ) );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
/*
|
||||
|
@ -418,7 +418,7 @@ int mbedtls_x509_csr_info( char *buf, size_t size, const char *prefix,
|
||||
}
|
||||
|
||||
ret = mbedtls_snprintf( p, n, "\n%s%-" BC "s: %d bits\n", prefix, key_size_str,
|
||||
(int) mbedtls_pk_get_size( &csr->pk ) );
|
||||
(int) mbedtls_pk_get_bitlen( &csr->pk ) );
|
||||
SAFE_SNPRINTF();
|
||||
|
||||
return( (int) ( size - n ) );
|
||||
|
Reference in New Issue
Block a user