From 07d2bc0ffe479dfe0de6e3c7db9910b2551f333d Mon Sep 17 00:00:00 2001 From: Waleed Elmelegy Date: Wed, 20 Nov 2024 11:45:28 +0000 Subject: [PATCH] Add headers for internal iop export public-key setup & abort APIs Signed-off-by: Waleed Elmelegy --- .../drivers/builtin/src/psa_crypto_ecp.h | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tf-psa-crypto/drivers/builtin/src/psa_crypto_ecp.h b/tf-psa-crypto/drivers/builtin/src/psa_crypto_ecp.h index f3ff32328b..506516de76 100644 --- a/tf-psa-crypto/drivers/builtin/src/psa_crypto_ecp.h +++ b/tf-psa-crypto/drivers/builtin/src/psa_crypto_ecp.h @@ -120,6 +120,44 @@ psa_status_t mbedtls_psa_ecp_export_public_key( const uint8_t *key_buffer, size_t key_buffer_size, uint8_t *data, size_t data_size, size_t *data_length); +/** + * \brief Setup a new interruptible export public-key operation. + * + * \param[in] operation The \c mbedtls_psa_export_public_key_iop_operation_t to use. + * This must be initialized first. + * \param[in] private_key pointer to private key. + * \param[in] private_key_len size of \p private_key in bytes. + * \param[in] private_key_attributes Key attributes of the private key. + * + * \retval #PSA_SUCCESS + * The operation started successfully - call \c mbedtls_psa_ecp_export_public_key_iop_complete() + * with the same operation to complete the operation. + * \retval #PSA_ERROR_NOT_SUPPORTED + * Either no internal interruptible operations are + * currently supported, or the key attributes are not unsupported. + * \retval #PSA_ERROR_INSUFFICIENT_MEMORY + * There was insufficient memory to load the key representation. + * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription + * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription + * + */ +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); + +/** + * \brief Abort an interruptible export public-key operation. + * + * \param[in] operation The \c mbedtls_psa_export_public_key_iop_operation_t to abort. + * + * \retval #PSA_SUCCESS + * The operation was aborted successfully. + */ +psa_status_t mbedtls_psa_ecp_export_public_key_iop_abort( + mbedtls_psa_export_public_key_iop_operation_t *operation); + /** * \brief Generate an ECP key. *