crypto_struct.h
Go to the documentation of this file.
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef PSA_CRYPTO_STRUCT_H
#define PSA_CRYPTO_STRUCT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Include the Mbed TLS configuration file, the way Mbed TLS does it
* in each of its header files. */
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/cmac.h"
#include "mbedtls/gcm.h"
/* Include the context definition for the compiled-in drivers for the primitive
* algorithms. */
#include "psa/crypto_driver_contexts_primitives.h"
struct psa_hash_operation_s
{
unsigned int id;
psa_driver_hash_context_t ctx;
};
#define PSA_HASH_OPERATION_INIT {0, {0}}
static inline struct psa_hash_operation_s psa_hash_operation_init( void )
{
const struct psa_hash_operation_s v = PSA_HASH_OPERATION_INIT;
return( v );
}
struct psa_cipher_operation_s
{
unsigned int id;
unsigned int iv_required : 1;
unsigned int iv_set : 1;
uint8_t default_iv_length;
psa_driver_cipher_context_t ctx;
};
#define PSA_CIPHER_OPERATION_INIT {0, 0, 0, 0, {0}}
static inline struct psa_cipher_operation_s psa_cipher_operation_init( void )
{
const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
return( v );
}
/* Include the context definition for the compiled-in drivers for the composite
* algorithms. */
#include "psa/crypto_driver_contexts_composites.h"
struct psa_mac_operation_s
{
unsigned int id;
uint8_t mac_size;
unsigned int is_sign : 1;
psa_driver_mac_context_t ctx;
};
#define PSA_MAC_OPERATION_INIT {0, 0, 0, {0}}
static inline struct psa_mac_operation_s psa_mac_operation_init( void )
{
const struct psa_mac_operation_s v = PSA_MAC_OPERATION_INIT;
return( v );
}
struct psa_aead_operation_s
{
psa_algorithm_t alg;
unsigned int key_set : 1;
unsigned int iv_set : 1;
uint8_t iv_size;
uint8_t block_size;
union
{
unsigned dummy; /* Enable easier initializing of the union. */
mbedtls_cipher_context_t cipher;
} ctx;
};
#define PSA_AEAD_OPERATION_INIT {0, 0, 0, 0, 0, {0}}
static inline struct psa_aead_operation_s psa_aead_operation_init( void )
{
const struct psa_aead_operation_s v = PSA_AEAD_OPERATION_INIT;
return( v );
}
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF)
typedef struct
{
uint8_t *info;
size_t info_length;
#if PSA_HASH_MAX_SIZE > 0xff
#error "PSA_HASH_MAX_SIZE does not fit in uint8_t"
#endif
uint8_t offset_in_block;
uint8_t block_number;
unsigned int state : 2;
unsigned int info_set : 1;
uint8_t output_block[PSA_HASH_MAX_SIZE];
uint8_t prk[PSA_HASH_MAX_SIZE];
struct psa_mac_operation_s hmac;
} psa_hkdf_key_derivation_t;
#endif /* MBEDTLS_PSA_BUILTIN_ALG_HKDF */
#if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS)
typedef enum
{
PSA_TLS12_PRF_STATE_INIT, /* no input provided */
PSA_TLS12_PRF_STATE_SEED_SET, /* seed has been set */
PSA_TLS12_PRF_STATE_KEY_SET, /* key has been set */
PSA_TLS12_PRF_STATE_LABEL_SET, /* label has been set */
PSA_TLS12_PRF_STATE_OUTPUT /* output has been started */
} psa_tls12_prf_key_derivation_state_t;
typedef struct psa_tls12_prf_key_derivation_s
{
#if PSA_HASH_MAX_SIZE > 0xff
#error "PSA_HASH_MAX_SIZE does not fit in uint8_t"
#endif
/* Indicates how many bytes in the current HMAC block have
* not yet been read by the user. */
uint8_t left_in_block;
/* The 1-based number of the block. */
uint8_t block_number;
psa_tls12_prf_key_derivation_state_t state;
uint8_t *secret;
size_t secret_length;
uint8_t *seed;
size_t seed_length;
uint8_t *label;
size_t label_length;
uint8_t Ai[PSA_HASH_MAX_SIZE];
/* `HMAC_hash( prk, A(i) + seed )` in the notation of RFC 5246, Sect. 5. */
uint8_t output_block[PSA_HASH_MAX_SIZE];
} psa_tls12_prf_key_derivation_t;
#endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) ||
* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */
struct psa_key_derivation_s
{
psa_algorithm_t alg;
unsigned int can_output_key : 1;
size_t capacity;
union
{
/* Make the union non-empty even with no supported algorithms. */
uint8_t dummy;
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF)
psa_hkdf_key_derivation_t hkdf;
#endif
#if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS)
psa_tls12_prf_key_derivation_t tls12_prf;
#endif
} ctx;
};
/* This only zeroes out the first byte in the union, the rest is unspecified. */
#define PSA_KEY_DERIVATION_OPERATION_INIT {0, 0, 0, {0}}
static inline struct psa_key_derivation_s psa_key_derivation_operation_init( void )
{
const struct psa_key_derivation_s v = PSA_KEY_DERIVATION_OPERATION_INIT;
return( v );
}
struct psa_key_policy_s
{
psa_key_usage_t usage;
psa_algorithm_t alg;
psa_algorithm_t alg2;
};
typedef struct psa_key_policy_s psa_key_policy_t;
#define PSA_KEY_POLICY_INIT {0, 0, 0}
static inline struct psa_key_policy_s psa_key_policy_init( void )
{
const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT;
return( v );
}
/* The type used internally for key sizes.
* Public interfaces use size_t, but internally we use a smaller type. */
typedef uint16_t psa_key_bits_t;
/* The maximum value of the type used to represent bit-sizes.
* This is used to mark an invalid key size. */
#define PSA_KEY_BITS_TOO_LARGE ( (psa_key_bits_t) ( -1 ) )
/* The maximum size of a key in bits.
* Currently defined as the maximum that can be represented, rounded down
* to a whole number of bytes.
* This is an uncast value so that it can be used in preprocessor
* conditionals. */
#define PSA_MAX_KEY_BITS 0xfff8
typedef uint16_t psa_key_attributes_flag_t;
#define MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER \
( (psa_key_attributes_flag_t) 0x0001 )
/* A mask of key attribute flags used externally only.
* Only meant for internal checks inside the library. */
#define MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY ( \
MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER | \
0 )
/* A mask of key attribute flags used both internally and externally.
* Currently there aren't any. */
#define MBEDTLS_PSA_KA_MASK_DUAL_USE ( \
0 )
typedef struct
{
psa_key_type_t type;
psa_key_bits_t bits;
psa_key_lifetime_t lifetime;
mbedtls_svc_key_id_t id;
psa_key_policy_t policy;
psa_key_attributes_flag_t flags;
} psa_core_key_attributes_t;
#define PSA_CORE_KEY_ATTRIBUTES_INIT {PSA_KEY_TYPE_NONE, 0, PSA_KEY_LIFETIME_VOLATILE, MBEDTLS_SVC_KEY_ID_INIT, PSA_KEY_POLICY_INIT, 0}
struct psa_key_attributes_s
{
psa_core_key_attributes_t core;
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
psa_key_slot_number_t slot_number;
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
void *domain_parameters;
size_t domain_parameters_size;
};
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
#define PSA_KEY_ATTRIBUTES_INIT {PSA_CORE_KEY_ATTRIBUTES_INIT, 0, NULL, 0}
#else
#define PSA_KEY_ATTRIBUTES_INIT {PSA_CORE_KEY_ATTRIBUTES_INIT, NULL, 0}
#endif
static inline struct psa_key_attributes_s psa_key_attributes_init( void )
{
const struct psa_key_attributes_s v = PSA_KEY_ATTRIBUTES_INIT;
return( v );
}
static inline void psa_set_key_id( psa_key_attributes_t *attributes,
mbedtls_svc_key_id_t key )
{
psa_key_lifetime_t lifetime = attributes->core.lifetime;
attributes->core.id = key;
if( PSA_KEY_LIFETIME_IS_VOLATILE( lifetime ) )
{
attributes->core.lifetime =
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
PSA_KEY_LIFETIME_PERSISTENT,
PSA_KEY_LIFETIME_GET_LOCATION( lifetime ) );
}
}
static inline mbedtls_svc_key_id_t psa_get_key_id(
const psa_key_attributes_t *attributes)
{
return( attributes->core.id );
}
#ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
static inline void mbedtls_set_key_owner_id( psa_key_attributes_t *attributes,
mbedtls_key_owner_id_t owner )
{
attributes->core.id.owner = owner;
}
#endif
static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes,
psa_key_lifetime_t lifetime)
{
attributes->core.lifetime = lifetime;
if( PSA_KEY_LIFETIME_IS_VOLATILE( lifetime ) )
{
#ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
attributes->core.id.key_id = 0;
#else
attributes->core.id = 0;
#endif
}
}
static inline psa_key_lifetime_t psa_get_key_lifetime(
const psa_key_attributes_t *attributes)
{
return( attributes->core.lifetime );
}
static inline void psa_extend_key_usage_flags( psa_key_usage_t *usage_flags )
{
if( *usage_flags & PSA_KEY_USAGE_SIGN_HASH )
*usage_flags |= PSA_KEY_USAGE_SIGN_MESSAGE;
if( *usage_flags & PSA_KEY_USAGE_VERIFY_HASH )
*usage_flags |= PSA_KEY_USAGE_VERIFY_MESSAGE;
}
static inline void psa_set_key_usage_flags(psa_key_attributes_t *attributes,
psa_key_usage_t usage_flags)
{
psa_extend_key_usage_flags( &usage_flags );
attributes->core.policy.usage = usage_flags;
}
static inline psa_key_usage_t psa_get_key_usage_flags(
const psa_key_attributes_t *attributes)
{
return( attributes->core.policy.usage );
}
static inline void psa_set_key_algorithm(psa_key_attributes_t *attributes,
psa_algorithm_t alg)
{
attributes->core.policy.alg = alg;
}
static inline psa_algorithm_t psa_get_key_algorithm(
const psa_key_attributes_t *attributes)
{
return( attributes->core.policy.alg );
}
/* This function is declared in crypto_extra.h, which comes after this
* header file, but we need the function here, so repeat the declaration. */
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);
static inline void psa_set_key_type(psa_key_attributes_t *attributes,
psa_key_type_t type)
{
if( attributes->domain_parameters == NULL )
{
/* Common case: quick path */
attributes->core.type = type;
}
else
{
/* Call the bigger function to free the old domain paramteres.
* Ignore any errors which may arise due to type requiring
* non-default domain parameters, since this function can't
* report errors. */
(void) psa_set_key_domain_parameters( attributes, type, NULL, 0 );
}
}
static inline psa_key_type_t psa_get_key_type(
const psa_key_attributes_t *attributes)
{
return( attributes->core.type );
}
static inline void psa_set_key_bits(psa_key_attributes_t *attributes,
size_t bits)
{
if( bits > PSA_MAX_KEY_BITS )
attributes->core.bits = PSA_KEY_BITS_TOO_LARGE;
else
attributes->core.bits = (psa_key_bits_t) bits;
}
static inline size_t psa_get_key_bits(
const psa_key_attributes_t *attributes)
{
return( attributes->core.bits );
}
#ifdef __cplusplus
}
#endif
#endif /* PSA_CRYPTO_STRUCT_H */
cmac.h
This file contains CMAC definitions and functions.
config.h
Configuration options (set of defines)
crypto_driver_contexts_composites.h
crypto_driver_contexts_primitives.h
PSA_HASH_MAX_SIZE
#define PSA_HASH_MAX_SIZE
Definition: crypto_sizes.h:136
PSA_KEY_BITS_TOO_LARGE
#define PSA_KEY_BITS_TOO_LARGE
Definition: crypto_struct.h:279
psa_set_key_usage_flags
static void psa_set_key_usage_flags(psa_key_attributes_t *attributes, psa_key_usage_t usage_flags)
Definition: crypto_struct.h:403
psa_aead_operation_init
static struct psa_aead_operation_s psa_aead_operation_init(void)
Definition: crypto_struct.h:167
psa_key_bits_t
uint16_t psa_key_bits_t
Definition: crypto_struct.h:276
psa_get_key_bits
static size_t psa_get_key_bits(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:468
PSA_KEY_POLICY_INIT
#define PSA_KEY_POLICY_INIT
Definition: crypto_struct.h:267
psa_set_key_type
static void psa_set_key_type(psa_key_attributes_t *attributes, psa_key_type_t type)
Definition: crypto_struct.h:435
psa_key_attributes_init
static struct psa_key_attributes_s psa_key_attributes_init(void)
Definition: crypto_struct.h:338
psa_key_attributes_flag_t
uint16_t psa_key_attributes_flag_t
Definition: crypto_struct.h:294
psa_cipher_operation_init
static struct psa_cipher_operation_s psa_cipher_operation_init(void)
Definition: crypto_struct.h:121
psa_key_derivation_operation_init
static struct psa_key_derivation_s psa_key_derivation_operation_init(void)
Definition: crypto_struct.h:253
psa_set_key_domain_parameters
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)
psa_tls12_prf_key_derivation_t
struct psa_tls12_prf_key_derivation_s psa_tls12_prf_key_derivation_t
PSA_MAX_KEY_BITS
#define PSA_MAX_KEY_BITS
Definition: crypto_struct.h:285
psa_get_key_lifetime
static psa_key_lifetime_t psa_get_key_lifetime(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:388
psa_get_key_usage_flags
static psa_key_usage_t psa_get_key_usage_flags(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:410
psa_extend_key_usage_flags
static void psa_extend_key_usage_flags(psa_key_usage_t *usage_flags)
Definition: crypto_struct.h:394
psa_mac_operation_init
static struct psa_mac_operation_s psa_mac_operation_init(void)
Definition: crypto_struct.h:146
psa_set_key_lifetime
static void psa_set_key_lifetime(psa_key_attributes_t *attributes, psa_key_lifetime_t lifetime)
Definition: crypto_struct.h:374
psa_get_key_algorithm
static psa_algorithm_t psa_get_key_algorithm(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:422
psa_hash_operation_init
static struct psa_hash_operation_s psa_hash_operation_init(void)
Definition: crypto_struct.h:96
psa_set_key_id
static void psa_set_key_id(psa_key_attributes_t *attributes, mbedtls_svc_key_id_t key)
Definition: crypto_struct.h:344
psa_get_key_type
static psa_key_type_t psa_get_key_type(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:453
psa_set_key_algorithm
static void psa_set_key_algorithm(psa_key_attributes_t *attributes, psa_algorithm_t alg)
Definition: crypto_struct.h:416
psa_tls12_prf_key_derivation_state_t
psa_tls12_prf_key_derivation_state_t
Definition: crypto_struct.h:194
PSA_TLS12_PRF_STATE_SEED_SET
@ PSA_TLS12_PRF_STATE_SEED_SET
Definition: crypto_struct.h:196
PSA_TLS12_PRF_STATE_LABEL_SET
@ PSA_TLS12_PRF_STATE_LABEL_SET
Definition: crypto_struct.h:198
PSA_TLS12_PRF_STATE_OUTPUT
@ PSA_TLS12_PRF_STATE_OUTPUT
Definition: crypto_struct.h:199
PSA_TLS12_PRF_STATE_KEY_SET
@ PSA_TLS12_PRF_STATE_KEY_SET
Definition: crypto_struct.h:197
PSA_TLS12_PRF_STATE_INIT
@ PSA_TLS12_PRF_STATE_INIT
Definition: crypto_struct.h:195
psa_set_key_bits
static void psa_set_key_bits(psa_key_attributes_t *attributes, size_t bits)
Definition: crypto_struct.h:459
psa_get_key_id
static mbedtls_svc_key_id_t psa_get_key_id(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:360
psa_key_policy_init
static struct psa_key_policy_s psa_key_policy_init(void)
Definition: crypto_struct.h:268
gcm.h
This file contains GCM definitions and functions.
PSA_MAC_OPERATION_INIT
#define PSA_MAC_OPERATION_INIT
Definition: crypto_struct.h:145
PSA_AEAD_OPERATION_INIT
#define PSA_AEAD_OPERATION_INIT
Definition: crypto_struct.h:166
PSA_KEY_ATTRIBUTES_INIT
#define PSA_KEY_ATTRIBUTES_INIT
Definition: crypto_struct.h:335
PSA_CIPHER_OPERATION_INIT
#define PSA_CIPHER_OPERATION_INIT
Definition: crypto_struct.h:120
psa_key_type_t
uint16_t psa_key_type_t
Encoding of a key type.
Definition: crypto_types.h:73
psa_algorithm_t
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:105
psa_status_t
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:62
PSA_HASH_OPERATION_INIT
#define PSA_HASH_OPERATION_INIT
Definition: crypto_struct.h:95
PSA_KEY_DERIVATION_OPERATION_INIT
#define PSA_KEY_DERIVATION_OPERATION_INIT
Definition: crypto_struct.h:252
PSA_KEY_LIFETIME_PERSISTENT
#define PSA_KEY_LIFETIME_PERSISTENT
Definition: crypto_values.h:1956
PSA_KEY_LIFETIME_GET_LOCATION
#define PSA_KEY_LIFETIME_GET_LOCATION(lifetime)
Definition: crypto_values.h:1979
PSA_KEY_LIFETIME_IS_VOLATILE
#define PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)
Definition: crypto_values.h:1998
psa_key_lifetime_t
uint32_t psa_key_lifetime_t
Definition: crypto_types.h:146
mbedtls_svc_key_id_t
psa_key_id_t mbedtls_svc_key_id_t
Definition: crypto_types.h:227
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION
#define PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location)
Definition: crypto_values.h:2032
PSA_KEY_USAGE_SIGN_HASH
#define PSA_KEY_USAGE_SIGN_HASH
Definition: crypto_values.h:2236
PSA_KEY_USAGE_SIGN_MESSAGE
#define PSA_KEY_USAGE_SIGN_MESSAGE
Definition: crypto_values.h:2216
psa_key_usage_t
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition: crypto_types.h:250
PSA_KEY_USAGE_VERIFY_MESSAGE
#define PSA_KEY_USAGE_VERIFY_MESSAGE
Definition: crypto_values.h:2226
PSA_KEY_USAGE_VERIFY_HASH
#define PSA_KEY_USAGE_VERIFY_HASH
Definition: crypto_values.h:2246
psa_key_slot_number_t
uint64_t psa_key_slot_number_t
Definition: crypto_se_driver.h:148
mbedtls_cipher_context_t
Definition: cipher.h:319
psa_aead_operation_s
Definition: crypto_struct.h:153
psa_aead_operation_s::dummy
unsigned dummy
Definition: crypto_struct.h:161
psa_aead_operation_s::block_size
uint8_t block_size
Definition: crypto_struct.h:158
psa_aead_operation_s::ctx
union psa_aead_operation_s::@7 ctx
psa_aead_operation_s::key_set
unsigned int key_set
Definition: crypto_struct.h:155
psa_aead_operation_s::iv_size
uint8_t iv_size
Definition: crypto_struct.h:157
psa_aead_operation_s::alg
psa_algorithm_t alg
Definition: crypto_struct.h:154
psa_aead_operation_s::iv_set
unsigned int iv_set
Definition: crypto_struct.h:156
psa_aead_operation_s::cipher
mbedtls_cipher_context_t cipher
Definition: crypto_struct.h:162
psa_cipher_operation_s
Definition: crypto_struct.h:103
psa_cipher_operation_s::id
unsigned int id
Definition: crypto_struct.h:110
psa_cipher_operation_s::iv_set
unsigned int iv_set
Definition: crypto_struct.h:113
psa_cipher_operation_s::ctx
psa_driver_cipher_context_t ctx
Definition: crypto_struct.h:117
psa_cipher_operation_s::iv_required
unsigned int iv_required
Definition: crypto_struct.h:112
psa_cipher_operation_s::default_iv_length
uint8_t default_iv_length
Definition: crypto_struct.h:115
psa_core_key_attributes_t
Definition: crypto_struct.h:311
psa_core_key_attributes_t::id
mbedtls_svc_key_id_t id
Definition: crypto_struct.h:315
psa_core_key_attributes_t::bits
psa_key_bits_t bits
Definition: crypto_struct.h:313
psa_core_key_attributes_t::lifetime
psa_key_lifetime_t lifetime
Definition: crypto_struct.h:314
psa_core_key_attributes_t::policy
psa_key_policy_t policy
Definition: crypto_struct.h:316
psa_core_key_attributes_t::flags
psa_key_attributes_flag_t flags
Definition: crypto_struct.h:317
psa_core_key_attributes_t::type
psa_key_type_t type
Definition: crypto_struct.h:312
psa_hash_operation_s
Definition: crypto_struct.h:84
psa_hash_operation_s::ctx
psa_driver_hash_context_t ctx
Definition: crypto_struct.h:92
psa_hash_operation_s::id
unsigned int id
Definition: crypto_struct.h:91
psa_hkdf_key_derivation_t
Definition: crypto_struct.h:175
psa_hkdf_key_derivation_t::info_set
unsigned int info_set
Definition: crypto_struct.h:184
psa_hkdf_key_derivation_t::info_length
size_t info_length
Definition: crypto_struct.h:177
psa_hkdf_key_derivation_t::offset_in_block
uint8_t offset_in_block
Definition: crypto_struct.h:181
psa_hkdf_key_derivation_t::state
unsigned int state
Definition: crypto_struct.h:183
psa_hkdf_key_derivation_t::block_number
uint8_t block_number
Definition: crypto_struct.h:182
psa_hkdf_key_derivation_t::info
uint8_t * info
Definition: crypto_struct.h:176
psa_key_attributes_s
Definition: crypto_struct.h:323
psa_key_attributes_s::domain_parameters_size
size_t domain_parameters_size
Definition: crypto_struct.h:329
psa_key_attributes_s::domain_parameters
void * domain_parameters
Definition: crypto_struct.h:328
psa_key_attributes_s::core
psa_core_key_attributes_t core
Definition: crypto_struct.h:324
psa_key_derivation_s
Definition: crypto_struct.h:233
psa_key_derivation_s::ctx
union psa_key_derivation_s::@8 ctx
psa_key_derivation_s::dummy
uint8_t dummy
Definition: crypto_struct.h:240
psa_key_derivation_s::can_output_key
unsigned int can_output_key
Definition: crypto_struct.h:235
psa_key_derivation_s::capacity
size_t capacity
Definition: crypto_struct.h:236
psa_key_derivation_s::alg
psa_algorithm_t alg
Definition: crypto_struct.h:234
psa_key_derivation_s::hkdf
psa_hkdf_key_derivation_t hkdf
Definition: crypto_struct.h:242
psa_key_derivation_s::tls12_prf
psa_tls12_prf_key_derivation_t tls12_prf
Definition: crypto_struct.h:246
psa_key_policy_s
Definition: crypto_struct.h:260
psa_key_policy_s::usage
psa_key_usage_t usage
Definition: crypto_struct.h:261
psa_key_policy_s::alg2
psa_algorithm_t alg2
Definition: crypto_struct.h:263
psa_key_policy_s::alg
psa_algorithm_t alg
Definition: crypto_struct.h:262
psa_mac_operation_s
Definition: crypto_struct.h:132
psa_mac_operation_s::mac_size
uint8_t mac_size
Definition: crypto_struct.h:140
psa_mac_operation_s::id
unsigned int id
Definition: crypto_struct.h:139
psa_mac_operation_s::ctx
psa_driver_mac_context_t ctx
Definition: crypto_struct.h:142
psa_mac_operation_s::is_sign
unsigned int is_sign
Definition: crypto_struct.h:141
psa_tls12_prf_key_derivation_s
Definition: crypto_struct.h:203
psa_tls12_prf_key_derivation_s::secret
uint8_t * secret
Definition: crypto_struct.h:217
psa_tls12_prf_key_derivation_s::state
psa_tls12_prf_key_derivation_state_t state
Definition: crypto_struct.h:215
psa_tls12_prf_key_derivation_s::seed_length
size_t seed_length
Definition: crypto_struct.h:220
psa_tls12_prf_key_derivation_s::left_in_block
uint8_t left_in_block
Definition: crypto_struct.h:210
psa_tls12_prf_key_derivation_s::secret_length
size_t secret_length
Definition: crypto_struct.h:218
psa_tls12_prf_key_derivation_s::label
uint8_t * label
Definition: crypto_struct.h:221
psa_tls12_prf_key_derivation_s::seed
uint8_t * seed
Definition: crypto_struct.h:219
psa_tls12_prf_key_derivation_s::Ai
uint8_t Ai[PSA_HASH_MAX_SIZE]
Definition: crypto_struct.h:224
psa_tls12_prf_key_derivation_s::label_length
size_t label_length
Definition: crypto_struct.h:222
psa_tls12_prf_key_derivation_s::output_block
uint8_t output_block[PSA_HASH_MAX_SIZE]
Definition: crypto_struct.h:227
psa_tls12_prf_key_derivation_s::block_number
uint8_t block_number
Definition: crypto_struct.h:213
psa_driver_cipher_context_t
Definition: crypto_driver_contexts_primitives.h:107
psa_driver_hash_context_t
Definition: crypto_driver_contexts_primitives.h:99
psa_driver_mac_context_t
Definition: crypto_driver_contexts_composites.h:83