mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-26 03:35:35 +00:00
psa: mac: Add driver dispatch tests for psa_mac_compute
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
c3dd75f71b
commit
094b06a572
@ -1118,7 +1118,31 @@ void mac_sign( int key_type_arg,
|
||||
ASSERT_ALLOC( actual_mac, mac_buffer_size );
|
||||
mbedtls_test_driver_mac_hooks.forced_status = forced_status;
|
||||
|
||||
/* Calculate the MAC. */
|
||||
/*
|
||||
* Calculate the MAC, one-shot case.
|
||||
*/
|
||||
status = psa_mac_compute( key, alg,
|
||||
input->x, input->len,
|
||||
actual_mac, mac_buffer_size,
|
||||
&mac_length );
|
||||
|
||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 1 );
|
||||
if( forced_status == PSA_SUCCESS ||
|
||||
forced_status == PSA_ERROR_NOT_SUPPORTED )
|
||||
{
|
||||
PSA_ASSERT( status );
|
||||
}
|
||||
else
|
||||
TEST_EQUAL( forced_status, status );
|
||||
|
||||
if( mac_buffer_size > 0 )
|
||||
memset( actual_mac, 0, mac_buffer_size );
|
||||
mbedtls_test_driver_mac_hooks = mbedtls_test_driver_mac_hooks_init();
|
||||
mbedtls_test_driver_mac_hooks.forced_status = forced_status;
|
||||
|
||||
/*
|
||||
* Calculate the MAC, multipart case.
|
||||
*/
|
||||
status = psa_mac_sign_setup( &operation, key, alg );
|
||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 1 );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user