mbed TLS v2.24.0
|
PSA cryptography module: Mbed TLS structured type implementations. More...
#include "mbedtls/config.h"
#include "mbedtls/cipher.h"
#include "mbedtls/cmac.h"
#include "mbedtls/gcm.h"
#include "mbedtls/md.h"
#include "mbedtls/md2.h"
#include "mbedtls/md4.h"
#include "mbedtls/md5.h"
#include "mbedtls/ripemd160.h"
#include "mbedtls/sha1.h"
#include "mbedtls/sha256.h"
#include "mbedtls/sha512.h"
Go to the source code of this file.
Data Structures | |
struct | psa_hash_operation_s |
struct | psa_hmac_internal_data |
struct | psa_mac_operation_s |
struct | psa_cipher_operation_s |
struct | psa_aead_operation_s |
struct | psa_hkdf_key_derivation_t |
struct | psa_tls12_prf_key_derivation_s |
struct | psa_key_derivation_s |
struct | psa_key_policy_s |
struct | psa_core_key_attributes_t |
struct | psa_key_attributes_s |
Macros | |
#define | PSA_HASH_OPERATION_INIT {0, {0}} |
#define | PSA_MAC_OPERATION_INIT {0, 0, 0, 0, 0, 0, 0, {0}} |
#define | PSA_CIPHER_OPERATION_INIT {0, 0, 0, 0, 0, 0, {0}} |
#define | PSA_AEAD_OPERATION_INIT {0, 0, 0, 0, 0, {0}} |
#define | PSA_KEY_DERIVATION_OPERATION_INIT {0, 0, 0, {0}} |
#define | PSA_KEY_POLICY_INIT {0, 0, 0} |
#define | PSA_KEY_BITS_TOO_LARGE ( (psa_key_bits_t) ( -1 ) ) |
#define | PSA_MAX_KEY_BITS 0xfff8 |
#define | MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER ( (psa_key_attributes_flag_t) 0x0001 ) |
#define | MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY |
#define | MBEDTLS_PSA_KA_MASK_DUAL_USE |
#define | PSA_CORE_KEY_ATTRIBUTES_INIT {PSA_KEY_TYPE_NONE, 0, PSA_KEY_LIFETIME_VOLATILE, PSA_KEY_ID_INIT, PSA_KEY_POLICY_INIT, 0} |
#define | PSA_KEY_ATTRIBUTES_INIT {PSA_CORE_KEY_ATTRIBUTES_INIT, 0, NULL, 0} |
Typedefs | |
typedef struct psa_tls12_prf_key_derivation_s | psa_tls12_prf_key_derivation_t |
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 |
Enumerations | |
enum | psa_tls12_prf_key_derivation_state_t { TLS12_PRF_STATE_INIT, TLS12_PRF_STATE_SEED_SET, TLS12_PRF_STATE_KEY_SET, TLS12_PRF_STATE_LABEL_SET, TLS12_PRF_STATE_OUTPUT } |
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.
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
.
Note that when alg
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 Crypto, multipart operation structures live independently from the key. This allows Mbed Crypto 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.
Definition in file crypto_struct.h.
#define MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER ( (psa_key_attributes_flag_t) 0x0001 ) |
Definition at line 314 of file crypto_struct.h.
Referenced by psa_clear_key_slot_number(), and psa_set_key_slot_number().
#define MBEDTLS_PSA_KA_MASK_DUAL_USE |
Definition at line 325 of file crypto_struct.h.
#define MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY |
Definition at line 319 of file crypto_struct.h.
#define PSA_CORE_KEY_ATTRIBUTES_INIT {PSA_KEY_TYPE_NONE, 0, PSA_KEY_LIFETIME_VOLATILE, PSA_KEY_ID_INIT, PSA_KEY_POLICY_INIT, 0} |
Definition at line 338 of file crypto_struct.h.
#define PSA_KEY_BITS_TOO_LARGE ( (psa_key_bits_t) ( -1 ) ) |
Definition at line 297 of file crypto_struct.h.
Referenced by psa_set_key_bits().
#define PSA_KEY_POLICY_INIT {0, 0, 0} |
Definition at line 285 of file crypto_struct.h.
Referenced by psa_key_policy_init().
#define PSA_MAX_KEY_BITS 0xfff8 |
Definition at line 303 of file crypto_struct.h.
Referenced by psa_set_key_bits().
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.
Definition at line 312 of file crypto_struct.h.
typedef uint16_t psa_key_bits_t |
Definition at line 294 of file crypto_struct.h.
typedef struct psa_key_policy_s psa_key_policy_t |
Definition at line 283 of file crypto_struct.h.
typedef struct psa_tls12_prf_key_derivation_s psa_tls12_prf_key_derivation_t |
Enumerator | |
---|---|
TLS12_PRF_STATE_INIT | |
TLS12_PRF_STATE_SEED_SET | |
TLS12_PRF_STATE_KEY_SET | |
TLS12_PRF_STATE_LABEL_SET | |
TLS12_PRF_STATE_OUTPUT |
Definition at line 217 of file crypto_struct.h.
|
static |
Definition at line 192 of file crypto_struct.h.
References PSA_AEAD_OPERATION_INIT.
|
static |
Definition at line 171 of file crypto_struct.h.
References PSA_CIPHER_OPERATION_INIT.
|
inlinestatic |
Definition at line 415 of file crypto_struct.h.
References psa_key_policy_s::alg, psa_key_attributes_s::core, and psa_core_key_attributes_t::policy.
|
inlinestatic |
Definition at line 461 of file crypto_struct.h.
References psa_core_key_attributes_t::bits, and psa_key_attributes_s::core.
|
inlinestatic |
Definition at line 370 of file crypto_struct.h.
References psa_key_attributes_s::core, and psa_core_key_attributes_t::id.
|
inlinestatic |
Definition at line 391 of file crypto_struct.h.
References psa_key_attributes_s::core, and psa_core_key_attributes_t::lifetime.
|
inlinestatic |
Definition at line 446 of file crypto_struct.h.
References psa_key_attributes_s::core, and psa_core_key_attributes_t::type.
|
inlinestatic |
Definition at line 403 of file crypto_struct.h.
References psa_key_attributes_s::core, psa_core_key_attributes_t::policy, and psa_key_policy_s::usage.
|
static |
Definition at line 111 of file crypto_struct.h.
References PSA_HASH_OPERATION_INIT.
|
static |
Definition at line 356 of file crypto_struct.h.
References PSA_KEY_ATTRIBUTES_INIT.
|
static |
Definition at line 271 of file crypto_struct.h.
References PSA_KEY_DERIVATION_OPERATION_INIT.
|
static |
Definition at line 286 of file crypto_struct.h.
References PSA_KEY_POLICY_INIT.
|
static |
Definition at line 149 of file crypto_struct.h.
References PSA_MAC_OPERATION_INIT.
|
inlinestatic |
Definition at line 409 of file crypto_struct.h.
References psa_key_policy_s::alg, psa_key_attributes_s::core, and psa_core_key_attributes_t::policy.
|
inlinestatic |
Definition at line 452 of file crypto_struct.h.
References psa_core_key_attributes_t::bits, psa_key_attributes_s::core, PSA_KEY_BITS_TOO_LARGE, and PSA_MAX_KEY_BITS.
psa_status_t 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_set_key_type().
|
inlinestatic |
Definition at line 362 of file crypto_struct.h.
References psa_key_attributes_s::core, psa_core_key_attributes_t::id, psa_core_key_attributes_t::lifetime, PSA_KEY_LIFETIME_PERSISTENT, and PSA_KEY_LIFETIME_VOLATILE.
|
inlinestatic |
Definition at line 376 of file crypto_struct.h.
References psa_key_attributes_s::core, psa_core_key_attributes_t::id, psa_key_file_id_t::key_id, psa_core_key_attributes_t::lifetime, psa_key_file_id_t::owner, and PSA_KEY_LIFETIME_VOLATILE.
|
inlinestatic |
Definition at line 428 of file crypto_struct.h.
References psa_key_attributes_s::core, psa_key_attributes_s::domain_parameters, psa_set_key_domain_parameters(), and psa_core_key_attributes_t::type.
|
inlinestatic |
Definition at line 397 of file crypto_struct.h.
References psa_key_attributes_s::core, psa_core_key_attributes_t::policy, and psa_key_policy_s::usage.