@@ -965,7 +965,7 @@ psa_status_t psa_destroy_key( psa_key_handle_t handle )
965
965
}
966
966
967
967
/* Return the size of the key in the given slot, in bits. */
968
- static size_t psa_get_key_bits ( const psa_key_slot_t * slot )
968
+ static size_t psa_get_key_slot_bits ( const psa_key_slot_t * slot )
969
969
{
970
970
if ( key_type_is_raw_bytes ( slot -> type ) )
971
971
return ( slot -> data .raw .bytes * 8 );
@@ -1001,7 +1001,7 @@ psa_status_t psa_get_key_information( psa_key_handle_t handle,
1001
1001
if ( type != NULL )
1002
1002
* type = slot -> type ;
1003
1003
if ( bits != NULL )
1004
- * bits = psa_get_key_bits ( slot );
1004
+ * bits = psa_get_key_slot_bits ( slot );
1005
1005
return ( PSA_SUCCESS );
1006
1006
}
1007
1007
@@ -1050,7 +1050,7 @@ static psa_status_t psa_internal_export_key( const psa_key_slot_t *slot,
1050
1050
{
1051
1051
psa_status_t status ;
1052
1052
1053
- size_t bytes = PSA_BITS_TO_BYTES ( psa_get_key_bits ( slot ) );
1053
+ size_t bytes = PSA_BITS_TO_BYTES ( psa_get_key_slot_bits ( slot ) );
1054
1054
if ( bytes > data_size )
1055
1055
return ( PSA_ERROR_BUFFER_TOO_SMALL );
1056
1056
status = mbedtls_to_psa_error (
@@ -1285,7 +1285,7 @@ static psa_status_t psa_finish_key_creation( psa_key_slot_t *slot )
1285
1285
size_t length ;
1286
1286
1287
1287
buffer_size = PSA_KEY_EXPORT_MAX_SIZE ( slot -> type ,
1288
- psa_get_key_bits ( slot ) );
1288
+ psa_get_key_slot_bits ( slot ) );
1289
1289
buffer = mbedtls_calloc ( 1 , buffer_size );
1290
1290
if ( buffer == NULL && buffer_size != 0 )
1291
1291
return ( PSA_ERROR_INSUFFICIENT_MEMORY );
@@ -1355,7 +1355,7 @@ static psa_status_t psa_copy_key_material( const psa_key_slot_t *source,
1355
1355
size_t length ;
1356
1356
1357
1357
buffer_size = PSA_KEY_EXPORT_MAX_SIZE ( source -> type ,
1358
- psa_get_key_bits ( source ) );
1358
+ psa_get_key_slot_bits ( source ) );
1359
1359
buffer = mbedtls_calloc ( 1 , buffer_size );
1360
1360
if ( buffer == NULL && buffer_size != 0 )
1361
1361
return ( PSA_ERROR_INSUFFICIENT_MEMORY );
@@ -2149,7 +2149,7 @@ static psa_status_t psa_mac_setup( psa_mac_operation_t *operation,
2149
2149
status = psa_get_key_from_slot ( handle , & slot , usage , alg );
2150
2150
if ( status != PSA_SUCCESS )
2151
2151
goto exit ;
2152
- key_bits = psa_get_key_bits ( slot );
2152
+ key_bits = psa_get_key_slot_bits ( slot );
2153
2153
2154
2154
#if defined(MBEDTLS_CMAC_C )
2155
2155
if ( full_length_alg == PSA_ALG_CMAC )
@@ -3060,7 +3060,7 @@ static psa_status_t psa_cipher_setup( psa_cipher_operation_t *operation,
3060
3060
status = psa_get_key_from_slot ( handle , & slot , usage , alg );
3061
3061
if ( status != PSA_SUCCESS )
3062
3062
goto exit ;
3063
- key_bits = psa_get_key_bits ( slot );
3063
+ key_bits = psa_get_key_slot_bits ( slot );
3064
3064
3065
3065
cipher_info = mbedtls_cipher_info_from_psa ( alg , slot -> type , key_bits , NULL );
3066
3066
if ( cipher_info == NULL )
@@ -3470,7 +3470,7 @@ static psa_status_t psa_aead_setup( aead_operation_t *operation,
3470
3470
if ( status != PSA_SUCCESS )
3471
3471
return ( status );
3472
3472
3473
- key_bits = psa_get_key_bits ( operation -> slot );
3473
+ key_bits = psa_get_key_slot_bits ( operation -> slot );
3474
3474
3475
3475
operation -> cipher_info =
3476
3476
mbedtls_cipher_info_from_psa ( alg , operation -> slot -> type , key_bits ,
0 commit comments