![]() |
![]() |
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.
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.
#include <stdbool.h>#include <stdint.h>#include <ti/drivers/SHA2.h>#include <ti/drivers/AESECB.h>#include <ti/drivers/AESCCM.h>#include <ti/drivers/AESGCM.h>#include <ti/devices/DeviceFamily.h>#include <ti/drivers/cryptoutils/cryptokey/CryptoKeyKeyStore_PSA.h>#include <third_party/psa_crypto/crypto_helper.h>

Go to the source code of this file.
Data Structures | |
| struct | psa_key_policy_s |
| struct | psa_core_key_attributes_t |
| struct | psa_key_attributes_s |
| struct | psa_hash_operation_s |
| struct | psa_cipher_operation_s |
| struct | psa_mac_operation_s |
| struct | psa_aead_operation_s |
| struct | psa_key_derivation_s |
Macros | |
| #define | PSA_KEY_POLICY_INIT |
| #define | PSA_KEY_BITS_TOO_LARGE ((psa_key_bits_t)(-1)) |
| #define | PSA_MAX_KEY_BITS 0xfff8 |
| #define | PSA_CRYPTO_KEY_ID_DEFAULT_OWNER -1 |
| #define | PSA_CORE_KEY_ATTRIBUTES_INIT |
| #define | PSA_KEY_ATTRIBUTES_INIT |
| #define | PSA_HASH_OPERATION_INIT |
| #define | PSA_CIPHER_OPERATION_INIT |
| #define | PSA_MAC_OPERATION_INIT |
| #define | PSA_AEAD_OPERATION_INIT |
| #define | PSA_KDF_LABEL_MAX_SIZE (224U - 20U) |
| #define | PSA_KEY_DERIVATION_OPERATION_INIT {0, MBEDTLS_SVC_KEY_ID_INIT, {0, 0, 0, 0, 0}, false, false} |
Typedefs | |
| typedef struct psa_key_policy_s | psa_key_policy_t |
| typedef uint16_t | psa_key_bits_t |
| typedef uint16_t | psa_key_attributes_flag_t |
| #define PSA_KEY_POLICY_INIT |
Referenced by psa_key_policy_init().
| #define PSA_KEY_BITS_TOO_LARGE ((psa_key_bits_t)(-1)) |
Referenced by psa_get_key_bits(), and psa_set_key_bits().
| #define PSA_MAX_KEY_BITS 0xfff8 |
Referenced by psa_get_key_bits(), and psa_set_key_bits().
| #define PSA_CRYPTO_KEY_ID_DEFAULT_OWNER -1 |
Referenced by psa_set_key_id().
| #define PSA_CORE_KEY_ATTRIBUTES_INIT |
| #define PSA_KDF_LABEL_MAX_SIZE (224U - 20U) |
The maximum length of the label used in the Key Derivation Function (KDF).
| typedef struct psa_key_policy_s psa_key_policy_t |
| typedef uint16_t psa_key_bits_t |
| typedef uint16_t psa_key_attributes_flag_t |
A mask of flags that can be stored in key attributes.
This type is also used internally to store flags in slots. Internal flags are defined in library/psa_crypto_core.h. Internal flags may have the same value as external flags if they are properly handled during key creation and in psa_get_key_attributes.
|
static |
References PSA_KEY_POLICY_INIT.
| psa_status_t tfm_crypto_get_caller_id | ( | int32_t * | id | ) |
Referenced by psa_set_key_id().
|
inlinestatic |
References PSA_KEY_ATTRIBUTES_INIT.
|
inlinestatic |
References PSA_KEY_USAGE_SIGN_HASH, PSA_KEY_USAGE_SIGN_MESSAGE, PSA_KEY_USAGE_VERIFY_HASH, and PSA_KEY_USAGE_VERIFY_MESSAGE.
Referenced by psa_get_key_bits(), and psa_set_key_usage_flags().
|
inlinestatic |
References psa_key_attributes_s::core, psa_core_key_attributes_t::id, mbedtls_svc_key_id_t::key_id, psa_core_key_attributes_t::lifetime, mbedtls_svc_key_id_t::owner, PSA_CRYPTO_KEY_ID_DEFAULT_OWNER, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION, PSA_KEY_LIFETIME_GET_LOCATION, PSA_KEY_LIFETIME_IS_VOLATILE, PSA_KEY_LIFETIME_PERSISTENT, and tfm_crypto_get_caller_id().
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_key_attributes_s::core, psa_core_key_attributes_t::id, and mbedtls_svc_key_id_t::key_id.
Referenced by psa_get_key_bits().
|
inlinestatic |
|
inlinestatic |
References psa_key_attributes_s::core, and psa_core_key_attributes_t::lifetime.
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_key_attributes_s::core, psa_core_key_attributes_t::policy, psa_extend_key_usage_flags(), and psa_key_policy_s::usage.
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_key_attributes_s::core, psa_core_key_attributes_t::policy, and psa_key_policy_s::usage.
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_key_policy_s::alg, psa_key_attributes_s::core, and psa_core_key_attributes_t::policy.
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_key_policy_s::alg, psa_key_attributes_s::core, KeyMgmt_psa_set_key_domain_parameters(), and psa_core_key_attributes_t::policy.
Referenced by psa_get_key_bits().
| psa_status_t KeyMgmt_psa_set_key_domain_parameters | ( | psa_key_attributes_t * | attributes, |
| psa_key_type_t | type, | ||
| const uint8_t * | data, | ||
| size_t | data_length | ||
| ) |
Referenced by psa_get_key_algorithm().
|
inlinestatic |
References psa_key_attributes_s::core, and psa_core_key_attributes_t::type.
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_key_attributes_s::core, and psa_core_key_attributes_t::type.
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_core_key_attributes_t::bits, psa_key_attributes_s::core, PSA_KEY_BITS_TOO_LARGE, and PSA_MAX_KEY_BITS.
Referenced by psa_get_key_bits().
|
inlinestatic |
References psa_key_policy_s::alg, psa_core_key_attributes_t::bits, psa_key_attributes_s::core, KeyStore_PSA_getKeyAlgorithm(), KeyStore_PSA_getKeyBits(), KeyStore_PSA_getKeyId(), KeyStore_PSA_getKeyLifetime(), KeyStore_PSA_getKeyType(), KeyStore_PSA_getKeyUsageFlags(), KeyStore_PSA_setKeyAlgorithm(), KeyStore_PSA_setKeyBits(), KeyStore_PSA_setKeyId(), KeyStore_PSA_setKeyLifetime(), KeyStore_PSA_setKeyType(), KeyStore_PSA_setKeyUsageFlags(), psa_extend_key_usage_flags(), psa_get_key_algorithm(), psa_get_key_id(), psa_get_key_lifetime(), psa_get_key_type(), psa_get_key_usage_flags(), PSA_KEY_BITS_TOO_LARGE, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION, PSA_KEY_LIFETIME_GET_LOCATION, PSA_KEY_LIFETIME_IS_VOLATILE, PSA_KEY_LIFETIME_PERSISTENT, PSA_MAX_KEY_BITS, psa_set_key_algorithm(), psa_set_key_bits(), psa_set_key_id(), psa_set_key_lifetime(), psa_set_key_type(), psa_set_key_usage_flags(), toKeyID(), and toKeyStoreKeyID().
|
static |
References PSA_HASH_OPERATION_INIT.
|
static |
References PSA_CIPHER_OPERATION_INIT.
|
static |
References PSA_MAC_OPERATION_INIT.
|
static |
References PSA_AEAD_OPERATION_INIT, and PSA_HASH_MAX_SIZE.
|
static |
References PSA_KEY_DERIVATION_OPERATION_INIT.