mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-16 00:40:52 +00:00
Clarify why we set num_ops to 1 in iop key generation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
parent
6305f5d6ef
commit
19d418a471
@ -645,6 +645,10 @@ psa_status_t mbedtls_psa_ecp_generate_key_iop_complete(
|
||||
return mbedtls_to_psa_error(status);
|
||||
}
|
||||
|
||||
/* Our implementation of key generation only generates the private key
|
||||
which doesn't invlolve any ECC arithmetic operations so number of ops
|
||||
is less than 1 but we round up to 1 to differentiate between num ops of
|
||||
0 which means no work has been done this facilitates testing. */
|
||||
operation->num_ops = 1;
|
||||
|
||||
status = mbedtls_mpi_write_binary(&operation->ecp.d, key_output, key_output_size);
|
||||
|
@ -10174,6 +10174,12 @@ void generate_key(int type_arg,
|
||||
if (status == PSA_SUCCESS || status == PSA_OPERATION_INCOMPLETE) {
|
||||
num_ops = psa_generate_key_iop_get_num_ops(&operation);
|
||||
|
||||
/* Our implementation of key generation only generates the private key
|
||||
which doesn't invlolve any ECC arithmetic operations so number of ops
|
||||
is less than 1 but we round up to 1 to differentiate between num ops of
|
||||
0 which means no work has been done this facilitates testing.
|
||||
It is acceptable however for other implementations to set the number of
|
||||
ops to zero. */
|
||||
TEST_LE_U(num_ops_prior + 1, num_ops);
|
||||
|
||||
num_ops_prior = num_ops;
|
||||
|
Loading…
x
Reference in New Issue
Block a user