mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-04 22:19:05 +00: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:
parent
939bd9485d
commit
de1114c883
3 changed files with 32 additions and 24 deletions
|
|
@ -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 )
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue