From 1b49ef538443fcd008387cf570028cb6bbf026bf Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Fri, 3 Feb 2023 14:27:32 +0000 Subject: [PATCH] Fix abort documentation. Make it clear that these functions reset the number of ops, and remove statements that say they have no effect. Signed-off-by: Paul Elliott --- include/psa/crypto.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/include/psa/crypto.h b/include/psa/crypto.h index 482b58288..d371e1a1c 100644 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -4430,7 +4430,13 @@ psa_status_t psa_sign_hash_complete( * \warning This is a beta API, and thus subject to change * at any point. It is not bound by the usual * interface stability promises. - + * + * \note This function is the only function that clears + * the number of ops completed as part of the + * operation. Please ensure you copy this value via + * \c psa_sign_hash_get_num_ops() if required + * before calling. + * * \note Aborting an operation frees all associated * resources except for the \p operation structure * itself. Once aborted, the operation object can @@ -4442,8 +4448,7 @@ psa_status_t psa_sign_hash_complete( * particular, calling \c psa_sign_hash_abort() * after the operation has already been terminated * by a call to \c psa_sign_hash_abort() or - * psa_sign_hash_complete() is safe and has no - * effect. + * psa_sign_hash_complete() is safe. * * \param[in,out] operation Initialized sign hash operation. * @@ -4620,6 +4625,12 @@ psa_status_t psa_verify_hash_complete( * any point. It is not bound by the usual interface * stability promises. * + * \note This function is the only function that clears the + * number of ops completed as part of the operation. + * Please ensure you copy this value via + * \c psa_verify_hash_get_num_ops() if required + * before calling. + * * \note Aborting an operation frees all associated * resources except for the operation structure * itself. Once aborted, the operation object can be @@ -4631,8 +4642,7 @@ psa_status_t psa_verify_hash_complete( * In particular, calling \c psa_verify_hash_abort() * after the operation has already been terminated by * a call to \c psa_verify_hash_abort() or - * psa_verify_hash_complete() is safe and has no - * effect. + * psa_verify_hash_complete() is safe. * * \param[in,out] operation Initialized verify hash operation. *