PSA_CRYPTO_STRUCT_H macro
\file psa/crypto_struct.h PSA cryptography module: Mbed TLS structured type implementations This file contains the definitions of some data structures with implementation-specific definitions. In implementations with isolation between the application and the cryptography module, it is expected that the front-end and the back-end would have different versions of this file. Design notes about multipart operation structures For multipart operations without driver delegation support, each multipart operation structure contains a `psa_algorithm_t alg` field which indicates which specific algorithm the structure is for. When the structure is not in use, `alg` is 0. Most of the structure consists of a union which is discriminated by `alg`. For multipart operations with driver delegation support, each multipart operation structure contains an `unsigned int id` field indicating which driver got assigned to do the operation. When the structure is not in use, 'id' is 0. The structure contains also a driver context which is the union of the contexts of all drivers able to handle the type of multipart operation. Note that when `alg` or `id` is 0, the content of other fields is undefined. In particular, it is not guaranteed that a freshly-initialized structure is all-zero: we initialize structures to something like `{0, 0}`, which is only guaranteed to initializes the first member of the union; GCC and Clang initialize the whole structure to 0 (at the time of writing), but MSVC and CompCert don't. In Mbed TLS, multipart operation structures live independently from the key. This allows Mbed TLS to free the key objects when destroying a key slot. If a multipart operation needs to remember the key after the setup function returns, the operation structure needs to contain a copy of the key.
Syntax
#define PSA_CRYPTO_STRUCT_H
Notes
This file may not be included directly. Applications must include psa/crypto.h.
![]()
#define PSA_CRYPTO_STRUCT_H