Refactor out mac_sign_setup and mac_verify_setup
Since they became equivalent after moving the is_sign checking back to the PSA core, they're now redundant, and the generic mac_setup function can just be called directly. Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
8af5c5c7de
commit
9e15fb783c
1 changed files with 8 additions and 30 deletions
|
@ -383,28 +383,6 @@ static psa_status_t mac_compute(
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
}
|
}
|
||||||
|
|
||||||
static psa_status_t mac_sign_setup(
|
|
||||||
mbedtls_psa_mac_operation_t *operation,
|
|
||||||
const psa_key_attributes_t *attributes,
|
|
||||||
const uint8_t *key_buffer,
|
|
||||||
size_t key_buffer_size,
|
|
||||||
psa_algorithm_t alg )
|
|
||||||
{
|
|
||||||
return( mac_setup( operation,
|
|
||||||
attributes, key_buffer, key_buffer_size, alg ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
static psa_status_t mac_verify_setup(
|
|
||||||
mbedtls_psa_mac_operation_t *operation,
|
|
||||||
const psa_key_attributes_t *attributes,
|
|
||||||
const uint8_t *key_buffer,
|
|
||||||
size_t key_buffer_size,
|
|
||||||
psa_algorithm_t alg )
|
|
||||||
{
|
|
||||||
return( mac_setup( operation,
|
|
||||||
attributes, key_buffer, key_buffer_size, alg ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
static psa_status_t mac_update(
|
static psa_status_t mac_update(
|
||||||
mbedtls_psa_mac_operation_t *operation,
|
mbedtls_psa_mac_operation_t *operation,
|
||||||
const uint8_t *input,
|
const uint8_t *input,
|
||||||
|
@ -545,7 +523,7 @@ psa_status_t mbedtls_psa_mac_sign_setup(
|
||||||
size_t key_buffer_size,
|
size_t key_buffer_size,
|
||||||
psa_algorithm_t alg )
|
psa_algorithm_t alg )
|
||||||
{
|
{
|
||||||
return( mac_sign_setup( operation, attributes,
|
return( mac_setup( operation, attributes,
|
||||||
key_buffer, key_buffer_size, alg ) );
|
key_buffer, key_buffer_size, alg ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +534,7 @@ psa_status_t mbedtls_psa_mac_verify_setup(
|
||||||
size_t key_buffer_size,
|
size_t key_buffer_size,
|
||||||
psa_algorithm_t alg )
|
psa_algorithm_t alg )
|
||||||
{
|
{
|
||||||
return( mac_verify_setup( operation, attributes,
|
return( mac_setup( operation, attributes,
|
||||||
key_buffer, key_buffer_size, alg ) );
|
key_buffer, key_buffer_size, alg ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,7 +620,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_sign_setup(
|
||||||
psa_algorithm_t alg )
|
psa_algorithm_t alg )
|
||||||
{
|
{
|
||||||
if( is_mac_accelerated( alg ) )
|
if( is_mac_accelerated( alg ) )
|
||||||
return( mac_sign_setup( operation, attributes,
|
return( mac_setup( operation, attributes,
|
||||||
key_buffer, key_buffer_size, alg ) );
|
key_buffer, key_buffer_size, alg ) );
|
||||||
else
|
else
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
|
@ -656,7 +634,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_verify_setup(
|
||||||
psa_algorithm_t alg )
|
psa_algorithm_t alg )
|
||||||
{
|
{
|
||||||
if( is_mac_accelerated( alg ) )
|
if( is_mac_accelerated( alg ) )
|
||||||
return( mac_verify_setup( operation, attributes,
|
return( mac_setup( operation, attributes,
|
||||||
key_buffer, key_buffer_size, alg ) );
|
key_buffer, key_buffer_size, alg ) );
|
||||||
else
|
else
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
|
|
Loading…
Reference in a new issue