Function esp_idf_svc::sys::psa_hash_clone

source ยท
pub unsafe extern "C" fn psa_hash_clone(
    source_operation: *const psa_hash_operation_s,
    target_operation: *mut psa_hash_operation_s,
) -> i32
Expand description

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.

\param[in] source_operation The active hash operation to clone. \param[in,out] target_operation The operation object to set up. It must be initialized but not active.

\retval #PSA_SUCCESS \emptydescription \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription \retval #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.