mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
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>
This commit is contained in:
@ -453,7 +453,11 @@ uint32_t psa_driver_wrapper_sign_hash_get_num_ops(
|
||||
return 0;
|
||||
|
||||
case PSA_CRYPTO_MBED_TLS_DRIVER_ID:
|
||||
return( mbedtls_psa_sign_hash_get_num_ops(
|
||||
/* Internal implementation returns a delta of ops completed in the
|
||||
* last call to complete(), so need to add in ops already completed
|
||||
* before this.*/
|
||||
return( operation->num_ops +
|
||||
mbedtls_psa_sign_hash_get_num_ops(
|
||||
&operation->ctx.mbedtls_ctx )
|
||||
);
|
||||
|
||||
@ -478,7 +482,11 @@ uint32_t psa_driver_wrapper_verify_hash_get_num_ops(
|
||||
return 0;
|
||||
|
||||
case PSA_CRYPTO_MBED_TLS_DRIVER_ID:
|
||||
return( mbedtls_psa_verify_hash_get_num_ops(
|
||||
/* Internal implementation returns a delta of ops completed in the
|
||||
* last call to complete(), so need to add in ops already completed
|
||||
* before this.*/
|
||||
return ( operation->num_ops +
|
||||
mbedtls_psa_verify_hash_get_num_ops(
|
||||
&operation->ctx.mbedtls_ctx )
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user