mbedtls_psa_hash_finish() function
Finish the calculation of the Mbed TLS-calculated hash of a message. The application must call mbedtls_psa_hash_setup() before calling this function. This function calculates the hash of the message formed by concatenating the inputs passed to preceding calls to mbedtls_psa_hash_update(). When this function returns successfully, the operation becomes inactive. If this function returns an error status, the operation enters an error state and must be aborted by calling mbedtls_psa_hash_abort().
Arguments
operation
Active hash operation.
hash
Buffer where the hash is to be written.
hash_size
Size of the \p hash buffer in bytes.
hash_length
On success, the number of bytes that make up the hash value. This is always #PSA_HASH_LENGTH(\c alg) where \c alg is the hash algorithm that is calculated.
Return value
#PSA_SUCCESS Success. #PSA_ERROR_BAD_STATE The operation state is not valid (it must be active). #PSA_ERROR_BUFFER_TOO_SMALL The size of the \p hash buffer is too small. You can determine a sufficient buffer size by calling #PSA_HASH_LENGTH(\c alg) where \c alg is the hash algorithm that is calculated. #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
Notes
The signature of this function is that of a PSA driver hash_finish entry point. This function behaves as a hash_finish entry point as defined in the PSA driver interface specification for transparent drivers.
mbedtls_psa_hash_finish() is called by 2 functions and calls 5 functions:
![]()
mbedtls_psa_hash_finish()
mbedtls_psa_hash_finish() reads 2 variables:
![]()
mbedtls_psa_hash_finish()