mbedtls_psa_hash_setup() function
Set up a multipart hash operation using Mbed TLS routines. If an error occurs at any step after a call to mbedtls_psa_hash_setup(), the operation will need to be reset by a call to mbedtls_psa_hash_abort(). The core may call mbedtls_psa_hash_abort() at any time after the operation has been initialized. After a successful call to mbedtls_psa_hash_setup(), the core must eventually terminate the operation. The following events terminate an operation: - A successful call to mbedtls_psa_hash_finish() or mbedtls_psa_hash_verify(). - A call to mbedtls_psa_hash_abort().
Arguments
operation
The operation object to set up. It must have been initialized to all-zero and not yet be in use.
alg
The hash algorithm to compute (\c PSA_ALG_XXX value such that #PSA_ALG_IS_HASH(\p alg) is true).
Return value
#PSA_SUCCESS Success. #PSA_ERROR_NOT_SUPPORTED \p alg is not supported #PSA_ERROR_BAD_STATE The operation state is not valid (it must be inactive). #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription
Notes
The signature of this function is that of a PSA driver hash_setup entry point. This function behaves as a hash_setup entry point as defined in the PSA driver interface specification for transparent drivers.
![]()
status = mbedtls_psa_hash_setup(&operation, alg);
mbedtls_psa_hash_setup() is called by 2 functions and calls 10 functions:
![]()
mbedtls_psa_hash_setup()
mbedtls_psa_hash_setup() reads 2 variables and writes 1 variable:
![]()
mbedtls_psa_hash_setup()