Skip to content

Commit

Permalink
Add PSA iop export public-key get_num_ops() functionality
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Elmelegy <[email protected]>
  • Loading branch information
waleed-elmelegy-arm committed Dec 10, 2024
1 parent 50d8567 commit 5784dc5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tf-psa-crypto/core/psa_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,8 +1686,12 @@ static psa_status_t psa_export_public_key_iop_abort_internal(psa_export_public_k

uint32_t psa_export_public_key_iop_get_num_ops(psa_export_public_key_iop_t *operation)
{
#if defined(MBEDTLS_ECP_RESTARTABLE)
return operation->num_ops;
#else
(void) operation;
return 0;
#endif
}

psa_status_t psa_export_public_key_iop_setup(psa_export_public_key_iop_t *operation,
Expand Down Expand Up @@ -1761,6 +1765,8 @@ psa_status_t psa_export_public_key_iop_complete(psa_export_public_key_iop_t *ope
status = mbedtls_psa_ecp_export_public_key_iop_complete(&operation->ctx, data, data_size,
data_length);

operation->num_ops = mbedtls_psa_ecp_export_public_key_iop_get_num_ops(&operation->ctx);

if (status != PSA_OPERATION_INCOMPLETE) {
psa_export_public_key_iop_abort_internal(operation);

Expand Down

0 comments on commit 5784dc5

Please sign in to comment.