mbedtls_psa_mac_verify_finish() function
Finish the calculation of the MAC of a message and compare it with an expected value using Mbed TLS. The PSA core calls mbedtls_psa_mac_verify_setup() before calling this function. This function calculates the MAC of the message formed by concatenating the inputs passed to preceding calls to mbedtls_psa_mac_update(). It then compares the calculated MAC with the expected MAC passed as a parameter to this function. Whether this function returns successfully or not, the PSA core subsequently aborts the operation by calling mbedtls_psa_mac_abort().
Arguments
operation
Active MAC operation.
mac
Buffer containing the expected MAC value.
mac_length
Length in bytes of the expected MAC value. The PSA core guarantees that this length is a valid MAC length for the algorithm and key combination passed to mbedtls_psa_mac_verify_setup().
Return value
#PSA_SUCCESS The expected MAC is identical to the actual MAC of the message. #PSA_ERROR_INVALID_SIGNATURE The MAC of the message was calculated successfully, but it differs from the expected MAC. #PSA_ERROR_BAD_STATE The operation state is not valid (it must be an active mac verify operation). #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
Notes
The signature of this function is that of a PSA driver mac_verify_finish entry point. This function behaves as a mac_verify_finish entry point as defined in the PSA driver interface specification for transparent drivers.
mbedtls_psa_mac_verify_finish() is called by 1 function and calls 3 functions:
![]()
mbedtls_psa_mac_verify_finish()
mbedtls_psa_mac_verify_finish() reads 1 variable:
![]()
mbedtls_psa_mac_verify_finish()