Mbed OS Reference
Loading...
Searching...
No Matches
crypto_struct.h File Reference

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_operation_driver_context_t
 
struct  psa_hash_operation_s
 
struct  psa_mac_operation_s
 
struct  psa_cipher_operation_s
 
struct  psa_aead_operation_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}}
 This macro returns a suitable initializer for a hash operation object of type psa_hash_operation_t. More...
 
#define PSA_MAC_OPERATION_INIT   {0, 0, 0, 0, 0, 0, 0, {0}}
 This macro returns a suitable initializer for a MAC operation object of type psa_mac_operation_t. More...
 
#define PSA_CIPHER_OPERATION_INIT   {0, 0, 0, 0, 0, 0, 0, {0}}
 This macro returns a suitable initializer for a cipher operation object of type psa_cipher_operation_t. More...
 
#define PSA_AEAD_OPERATION_INIT   {0, 0, 0, 0, 0, {0}}
 This macro returns a suitable initializer for an AEAD operation object of type psa_aead_operation_t. More...
 
#define PSA_KEY_DERIVATION_OPERATION_INIT   {0, 0, 0, {0}}
 This macro returns a suitable initializer for a key derivation operation object of type psa_key_derivation_operation_t. More...
 
#define PSA_KEY_ATTRIBUTES_INIT   {PSA_CORE_KEY_ATTRIBUTES_INIT, NULL, 0}
 This macro returns a suitable initializer for a key attribute structure of type psa_key_attributes_t. More...
 

Typedefs

typedef uint16_t psa_key_attributes_flag_t
 A mask of flags that can be stored in key attributes. More...
 

Detailed Description

PSA cryptography module: Mbed TLS structured type implementations.

Note
This file may not be included directly. Applications must include psa/crypto.h.

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

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.

Typedef Documentation

◆ psa_key_attributes_flag_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.

Definition at line 324 of file crypto_struct.h.