mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-16 04:20:49 +00:00
Add internal iop export public-key setup API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
parent
9958ff6e96
commit
e2a9b6a3b5
@ -654,6 +654,31 @@ psa_status_t mbedtls_psa_ecp_generate_key_iop_abort(
|
||||
return PSA_SUCCESS;
|
||||
}
|
||||
|
||||
psa_status_t mbedtls_psa_ecp_export_public_key_iop_setup(
|
||||
mbedtls_psa_export_public_key_iop_operation_t *operation,
|
||||
uint8_t *private_key,
|
||||
size_t private_key_len,
|
||||
const psa_key_attributes_t *private_key_attributes)
|
||||
{
|
||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||
|
||||
status = mbedtls_psa_ecp_load_representation(
|
||||
psa_get_key_type(private_key_attributes),
|
||||
psa_get_key_bits(private_key_attributes),
|
||||
private_key,
|
||||
private_key_len,
|
||||
&operation->key);
|
||||
if (status != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_ecp_restart_init(&operation->restart_ctx);
|
||||
operation->num_ops = 0;
|
||||
|
||||
exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif
|
||||
/****************************************************************/
|
||||
/* Interruptible ECC Key Agreement */
|
||||
|
Loading…
x
Reference in New Issue
Block a user