mbedtls_psa_hash_clone() function
Clone an Mbed TLS hash operation. This function copies the state of an ongoing hash operation to a new operation object. In other words, this function is equivalent to calling mbedtls_psa_hash_setup() on \p target_operation with the same algorithm that \p source_operation was set up for, then mbedtls_psa_hash_update() on \p target_operation with the same input that that was passed to \p source_operation. After this function returns, the two objects are independent, i.e. subsequent calls involving one of the objects do not affect the other object.
Arguments
source_operation
The active hash operation to clone.
target_operation
The operation object to set up. It must be initialized but not active.
Return value
#PSA_SUCCESS \emptydescription #PSA_ERROR_BAD_STATE The \p source_operation state is not valid (it must be active). #PSA_ERROR_BAD_STATE The \p target_operation state is not valid (it must be inactive). #PSA_ERROR_CORRUPTION_DETECTED \emptydescription #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
Notes
The signature of this function is that of a PSA driver hash_clone entry point. This function behaves as a hash_clone entry point as defined in the PSA driver interface specification for transparent drivers.
mbedtls_psa_hash_clone() is called by 1 function and calls 4 functions:
![]()
mbedtls_psa_hash_clone()
mbedtls_psa_hash_clone() reads 2 variables and writes 1 variable:
![]()
mbedtls_psa_hash_clone()