Add psa_export_public_key_iop_s struct and docs

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
Waleed Elmelegy 2024-11-15 16:31:34 +00:00
parent 0cc68601e6
commit e34a5c5f9a
2 changed files with 69 additions and 0 deletions

View File

@ -5545,6 +5545,44 @@ psa_status_t psa_generate_key_iop_abort(
/**@}*/
/**
* \defgroup interruptible_export_public_key Interruptible public-key export
* @{
*/
/**
* The type of the state data structure for interruptible key generation
* operations.
*
* Before calling any function on an interruptible key generation object, the
* application must initialize it by any of the following means:
* - Set the structure to all-bits-zero, for example:
* \code
* psa_export_public_key_iop_t operation;
* memset(&operation, 0, sizeof(operation));
* \endcode
* - Initialize the structure to logical zero values, for example:
* \code
* static psa_export_public_key_iop_t operation;
* \endcode
* - Initialize the structure to the initializer #PSA_EXPORT_PUBLIC_KEY_IOP_INIT,
* for example:
* \code
* psa_export_public_key_iop_t operation = PSA_EXPORT_PUBLIC_KEY_IOP_INIT;
* \endcode
* - Assign the result of the function psa_generate_key_iop_init() to the
* structure, for example:
* \code
* psa_export_public_key_iop_t operation;
* operation = psa_export_public_key_iop_init();
* \endcode
*
* This is an implementation-defined \c struct. Applications should not
* make any assumptions about the content of this structure.
* Implementation details can change in future versions without notice.
*/
typedef struct psa_export_public_key_iop_s psa_export_public_key_iop_t;
#ifdef __cplusplus
}
#endif

View File

@ -568,6 +568,37 @@ psa_generate_key_iop_init(void)
return v;
}
/**
* \brief The context for PSA interruptible export public-key.
*/
struct psa_export_public_key_iop_s {
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
mbedtls_psa_client_handle_t handle;
#else
/**
* Unique ID indicating which driver got assigned to do the
* operation. Since driver contexts are driver-specific, swapping
* drivers halfway through the operation is not supported.
* ID values are auto-generated in psa_crypto_driver_wrappers.h
* ID value zero means the context is not valid or not assigned to
* any driver (i.e. none of the driver contexts are active).
*/
unsigned int MBEDTLS_PRIVATE(id);
#endif
};
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
#define PSA_EXPORT_PUBLIC_KEY_IOP_INIT { 0 }
#else
#define PSA_EXPORT_PUBLIC_KEY_IOP_INIT { 0 }
#endif
static inline struct psa_export_public_key_iop_s psa_export_public_key_iop_init(void)
{
const struct psa_export_public_key_iop_s v = PSA_EXPORT_PUBLIC_KEY_IOP_INIT;
return v;
}
#ifdef __cplusplus
}
#endif