1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

New macro PSA_ALG_FULL_LENGTH_MAC

Provide a documented way of constructing the full-length MAC algorithm
from a truncated version.
This commit is contained in:
Gilles Peskine
2018-10-17 18:28:05 +02:00
parent 57fbdb1939
commit e0e9c7c417
3 changed files with 18 additions and 1 deletions

View File

@@ -1527,7 +1527,7 @@ static psa_status_t psa_mac_setup( psa_mac_operation_t *operation,
psa_key_usage_t usage =
is_sign ? PSA_KEY_USAGE_SIGN : PSA_KEY_USAGE_VERIFY;
unsigned char truncated = PSA_MAC_TRUNCATED_LENGTH( alg );
psa_algorithm_t full_length_alg = alg & ~PSA_ALG_MAC_TRUNCATION_MASK;
psa_algorithm_t full_length_alg = PSA_ALG_FULL_LENGTH_MAC( alg );
status = psa_mac_init( operation, full_length_alg );
if( status != PSA_SUCCESS )