From e43aa39397d3c44e909413cb65a7b73c57a39b28 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 21 Jan 2019 14:50:37 +0100 Subject: [PATCH] hash_clone: Fix copypasta and add a functional description --- include/psa/crypto.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/psa/crypto.h b/include/psa/crypto.h index e639906d4..373c123cc 100644 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -922,6 +922,15 @@ psa_status_t psa_hash_verify(psa_hash_operation_t *operation, psa_status_t psa_hash_abort(psa_hash_operation_t *operation); /** 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. @@ -931,7 +940,7 @@ psa_status_t psa_hash_abort(psa_hash_operation_t *operation); * \retval #PSA_ERROR_BAD_STATE * \p source_operation is not an active hash operation. * \retval #PSA_ERROR_BAD_STATE - * \p source_operation is active. + * \p target_operation is active. * \retval #PSA_ERROR_COMMUNICATION_FAILURE * \retval #PSA_ERROR_HARDWARE_FAILURE * \retval #PSA_ERROR_TAMPERING_DETECTED