psa_hash_clone() function
Clone a 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 psa_hash_setup() on \p target_operation with the same algorithm that \p source_operation was set up for, then 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_COMMUNICATION_FAILURE \emptydescription #PSA_ERROR_HARDWARE_FAILURE \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription #PSA_ERROR_BAD_STATE The \p source_operation state is not valid (it must be active), or the \p target_operation state is not valid (it must be inactive), or the library has not been previously initialized by psa_crypto_init(). It is implementation-dependent whether a failure to initialize results in this error code.