mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-15 06:40:48 +00:00
Add PSA interruptible key generation get num ops API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
parent
1630603ef1
commit
208c01b663
@ -8121,8 +8121,7 @@ static psa_status_t psa_generate_key_iop_abort_internal(
|
||||
uint32_t psa_generate_key_iop_get_num_ops(
|
||||
psa_generate_key_iop_t *operation)
|
||||
{
|
||||
(void) operation;
|
||||
return 0;
|
||||
return operation->num_ops;
|
||||
}
|
||||
|
||||
psa_status_t psa_generate_key_iop_setup(
|
||||
@ -8197,6 +8196,8 @@ psa_status_t psa_generate_key_iop_complete(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
operation->num_ops = mbedtls_psa_generate_key_iop_get_num_ops(&operation->ctx);
|
||||
|
||||
status = psa_import_key(&operation->attributes,
|
||||
key_data + (sizeof(key_data) - key_len),
|
||||
key_len,
|
||||
|
@ -596,6 +596,12 @@ exit:
|
||||
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
|
||||
uint32_t mbedtls_psa_generate_key_iop_get_num_ops(
|
||||
mbedtls_psa_generate_key_iop_t *operation)
|
||||
{
|
||||
return operation->num_ops;
|
||||
}
|
||||
|
||||
psa_status_t mbedtls_psa_ecp_generate_key_iop_setup(
|
||||
mbedtls_psa_generate_key_iop_t *operation,
|
||||
const psa_key_attributes_t *attributes)
|
||||
|
@ -143,6 +143,17 @@ psa_status_t mbedtls_psa_ecp_generate_key(
|
||||
const psa_key_attributes_t *attributes,
|
||||
uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length);
|
||||
|
||||
/**
|
||||
* \brief Get the total number of ops that a key generation operation has taken
|
||||
* Since it's start.
|
||||
*
|
||||
* \param[in] operation The \c mbedtls_psa_generate_key_iop_t to use.
|
||||
* This must be initialized first.
|
||||
* \return Total number of operations.
|
||||
*/
|
||||
uint32_t mbedtls_psa_generate_key_iop_get_num_ops(
|
||||
mbedtls_psa_generate_key_iop_t *operation);
|
||||
|
||||
/**
|
||||
* \brief Setup a new interruptible key generation operation.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user