Skip to content

Commit e43aa39

Browse files
hash_clone: Fix copypasta and add a functional description
1 parent ebb2c3e commit e43aa39

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

include/psa/crypto.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,15 @@ psa_status_t psa_hash_verify(psa_hash_operation_t *operation,
922922
psa_status_t psa_hash_abort(psa_hash_operation_t *operation);
923923

924924
/** Clone a hash operation.
925+
*
926+
* This function copies the state of an ongoing hash operation to
927+
* a new operation object. In other words, this function is equivalent
928+
* to calling psa_hash_setup() on \p target_operation with the same
929+
* algorithm that \p source_operation was set up for, then
930+
* psa_hash_update() on \p target_operation with the same input that
931+
* that was passed to \p source_operation. After this function returns, the
932+
* two objects are independent, i.e. subsequent calls involving one of
933+
* the objects do not affect the other object.
925934
*
926935
* \param[in] source_operation The active hash operation to clone.
927936
* \param[in,out] target_operation The operation object to set up.
@@ -931,7 +940,7 @@ psa_status_t psa_hash_abort(psa_hash_operation_t *operation);
931940
* \retval #PSA_ERROR_BAD_STATE
932941
* \p source_operation is not an active hash operation.
933942
* \retval #PSA_ERROR_BAD_STATE
934-
* \p source_operation is active.
943+
* \p target_operation is active.
935944
* \retval #PSA_ERROR_COMMUNICATION_FAILURE
936945
* \retval #PSA_ERROR_HARDWARE_FAILURE
937946
* \retval #PSA_ERROR_TAMPERING_DETECTED

0 commit comments

Comments
 (0)