Fix {sign|verify}_get_num_ops
Move the obfuscation of the internal library only returning a delta of ops done
into the driver wrapper, thus meaning driver wrapper and API call both return
absolute values of work done. Document the differences at the internal
implementation level.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index d3ac4ce..419be16 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -3286,7 +3286,7 @@
exit:
/* Update ops count with work done. */
- operation->num_ops += psa_driver_wrapper_sign_hash_get_num_ops(operation);
+ operation->num_ops = psa_driver_wrapper_sign_hash_get_num_ops(operation);
if (status != PSA_OPERATION_INCOMPLETE) {
psa_wipe_output_buffer(signature, status, signature_size,
@@ -3413,7 +3413,7 @@
exit:
/* Update ops count with work done. */
- operation->num_ops += psa_driver_wrapper_verify_hash_get_num_ops(
+ operation->num_ops = psa_driver_wrapper_verify_hash_get_num_ops(
operation);
if (status != PSA_OPERATION_INCOMPLETE) {