Mbed TLS v2.28.8
crypto_struct.h
Go to the documentation of this file.
1 
44 /*
45  * Copyright The Mbed TLS Contributors
46  * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
47  */
48 
49 #ifndef PSA_CRYPTO_STRUCT_H
50 #define PSA_CRYPTO_STRUCT_H
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /* Include the Mbed TLS configuration file, the way Mbed TLS does it
57  * in each of its header files. */
58 #if !defined(MBEDTLS_CONFIG_FILE)
59 #include "mbedtls/config.h"
60 #else
61 #include MBEDTLS_CONFIG_FILE
62 #endif
63 
64 #include "mbedtls/cmac.h"
65 #include "mbedtls/gcm.h"
66 
67 /* Include the context definition for the compiled-in drivers for the primitive
68  * algorithms. */
70 
78  unsigned int id;
80 };
81 
82 #define PSA_HASH_OPERATION_INIT { 0, { 0 } }
84 {
86  return v;
87 }
88 
96  unsigned int id;
97 
98  unsigned int iv_required : 1;
99  unsigned int iv_set : 1;
100 
102 
104 };
105 
106 #define PSA_CIPHER_OPERATION_INIT { 0, 0, 0, 0, { 0 } }
108 {
110  return v;
111 }
112 
113 /* Include the context definition for the compiled-in drivers for the composite
114  * algorithms. */
116 
124  unsigned int id;
125  uint8_t mac_size;
126  unsigned int is_sign : 1;
128 };
129 
130 #define PSA_MAC_OPERATION_INIT { 0, 0, 0, { 0 } }
131 static inline struct psa_mac_operation_s psa_mac_operation_init(void)
132 {
134  return v;
135 }
136 
139  unsigned int key_set : 1;
140  unsigned int iv_set : 1;
141  uint8_t iv_size;
142  uint8_t block_size;
143  union {
144  unsigned dummy; /* Enable easier initializing of the union. */
146  } ctx;
147 };
148 
149 #define PSA_AEAD_OPERATION_INIT { 0, 0, 0, 0, 0, { 0 } }
151 {
153  return v;
154 }
155 
156 #if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF)
157 typedef struct {
158  uint8_t *info;
159  size_t info_length;
160 #if PSA_HASH_MAX_SIZE > 0xff
161 #error "PSA_HASH_MAX_SIZE does not fit in uint8_t"
162 #endif
164  uint8_t block_number;
165  unsigned int state : 2;
166  unsigned int info_set : 1;
167  uint8_t output_block[PSA_HASH_MAX_SIZE];
168  uint8_t prk[PSA_HASH_MAX_SIZE];
169  struct psa_mac_operation_s hmac;
171 #endif /* MBEDTLS_PSA_BUILTIN_ALG_HKDF */
172 
173 #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) || \
174  defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS)
175 typedef enum {
176  PSA_TLS12_PRF_STATE_INIT, /* no input provided */
177  PSA_TLS12_PRF_STATE_SEED_SET, /* seed has been set */
178  PSA_TLS12_PRF_STATE_KEY_SET, /* key has been set */
179  PSA_TLS12_PRF_STATE_LABEL_SET, /* label has been set */
180  PSA_TLS12_PRF_STATE_OUTPUT /* output has been started */
182 
184 #if PSA_HASH_MAX_SIZE > 0xff
185 #error "PSA_HASH_MAX_SIZE does not fit in uint8_t"
186 #endif
187 
188  /* Indicates how many bytes in the current HMAC block have
189  * not yet been read by the user. */
190  uint8_t left_in_block;
191 
192  /* The 1-based number of the block. */
193  uint8_t block_number;
194 
196 
197  uint8_t *secret;
199  uint8_t *seed;
200  size_t seed_length;
201  uint8_t *label;
202  size_t label_length;
203 
205 
206  /* `HMAC_hash( prk, A(i) + seed )` in the notation of RFC 5246, Sect. 5. */
209 #endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) ||
210  * MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */
211 
214  unsigned int can_output_key : 1;
215  size_t capacity;
216  union {
217  /* Make the union non-empty even with no supported algorithms. */
218  uint8_t dummy;
219 #if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF)
221 #endif
222 #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) || \
223  defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS)
225 #endif
226  } ctx;
227 };
228 
229 /* This only zeroes out the first byte in the union, the rest is unspecified. */
230 #define PSA_KEY_DERIVATION_OPERATION_INIT { 0, 0, 0, { 0 } }
232 {
234  return v;
235 }
236 
241 };
243 
244 #define PSA_KEY_POLICY_INIT { 0, 0, 0 }
245 static inline struct psa_key_policy_s psa_key_policy_init(void)
246 {
247  const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT;
248  return v;
249 }
250 
251 /* The type used internally for key sizes.
252  * Public interfaces use size_t, but internally we use a smaller type. */
253 typedef uint16_t psa_key_bits_t;
254 /* The maximum value of the type used to represent bit-sizes.
255  * This is used to mark an invalid key size. */
256 #define PSA_KEY_BITS_TOO_LARGE ((psa_key_bits_t) (-1))
257 /* The maximum size of a key in bits.
258  * Currently defined as the maximum that can be represented, rounded down
259  * to a whole number of bytes.
260  * This is an uncast value so that it can be used in preprocessor
261  * conditionals. */
262 #define PSA_MAX_KEY_BITS 0xfff8
263 
271 typedef uint16_t psa_key_attributes_flag_t;
272 
273 #define MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER \
274  ((psa_key_attributes_flag_t) 0x0001)
275 
276 /* A mask of key attribute flags used externally only.
277  * Only meant for internal checks inside the library. */
278 #define MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY ( \
279  MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER | \
280  0)
281 
282 /* A mask of key attribute flags used both internally and externally.
283  * Currently there aren't any. */
284 #define MBEDTLS_PSA_KA_MASK_DUAL_USE ( \
285  0)
286 
287 typedef struct {
295 
296 #define PSA_CORE_KEY_ATTRIBUTES_INIT { PSA_KEY_TYPE_NONE, 0, PSA_KEY_LIFETIME_VOLATILE, \
297  MBEDTLS_SVC_KEY_ID_INIT, PSA_KEY_POLICY_INIT, 0 }
298 
301 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
302  psa_key_slot_number_t slot_number;
303 #endif /* MBEDTLS_PSA_CRYPTO_SE_C */
306 };
307 
308 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
309 #define PSA_KEY_ATTRIBUTES_INIT { PSA_CORE_KEY_ATTRIBUTES_INIT, 0, NULL, 0 }
310 #else
311 #define PSA_KEY_ATTRIBUTES_INIT { PSA_CORE_KEY_ATTRIBUTES_INIT, NULL, 0 }
312 #endif
313 
315 {
317  return v;
318 }
319 
320 static inline void psa_set_key_id(psa_key_attributes_t *attributes,
322 {
323  psa_key_lifetime_t lifetime = attributes->core.lifetime;
324 
325  attributes->core.id = key;
326 
327  if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) {
328  attributes->core.lifetime =
332  }
333 }
334 
336  const psa_key_attributes_t *attributes)
337 {
338  return attributes->core.id;
339 }
340 
341 #ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
342 static inline void mbedtls_set_key_owner_id(psa_key_attributes_t *attributes,
343  mbedtls_key_owner_id_t owner)
344 {
345  attributes->core.id.owner = owner;
346 }
347 #endif
348 
349 static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes,
350  psa_key_lifetime_t lifetime)
351 {
352  attributes->core.lifetime = lifetime;
353  if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) {
354 #ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
355  attributes->core.id.key_id = 0;
356 #else
357  attributes->core.id = 0;
358 #endif
359  }
360 }
361 
363  const psa_key_attributes_t *attributes)
364 {
365  return attributes->core.lifetime;
366 }
367 
368 static inline void psa_extend_key_usage_flags(psa_key_usage_t *usage_flags)
369 {
370  if (*usage_flags & PSA_KEY_USAGE_SIGN_HASH) {
371  *usage_flags |= PSA_KEY_USAGE_SIGN_MESSAGE;
372  }
373 
374  if (*usage_flags & PSA_KEY_USAGE_VERIFY_HASH) {
375  *usage_flags |= PSA_KEY_USAGE_VERIFY_MESSAGE;
376  }
377 }
378 
379 static inline void psa_set_key_usage_flags(psa_key_attributes_t *attributes,
380  psa_key_usage_t usage_flags)
381 {
382  psa_extend_key_usage_flags(&usage_flags);
383  attributes->core.policy.usage = usage_flags;
384 }
385 
387  const psa_key_attributes_t *attributes)
388 {
389  return attributes->core.policy.usage;
390 }
391 
392 static inline void psa_set_key_algorithm(psa_key_attributes_t *attributes,
393  psa_algorithm_t alg)
394 {
395  attributes->core.policy.alg = alg;
396 }
397 
399  const psa_key_attributes_t *attributes)
400 {
401  return attributes->core.policy.alg;
402 }
403 
404 /* This function is declared in crypto_extra.h, which comes after this
405  * header file, but we need the function here, so repeat the declaration. */
407  psa_key_type_t type,
408  const uint8_t *data,
409  size_t data_length);
410 
411 static inline void psa_set_key_type(psa_key_attributes_t *attributes,
412  psa_key_type_t type)
413 {
414  if (attributes->domain_parameters == NULL) {
415  /* Common case: quick path */
416  attributes->core.type = type;
417  } else {
418  /* Call the bigger function to free the old domain parameters.
419  * Ignore any errors which may arise due to type requiring
420  * non-default domain parameters, since this function can't
421  * report errors. */
422  (void) psa_set_key_domain_parameters(attributes, type, NULL, 0);
423  }
424 }
425 
427  const psa_key_attributes_t *attributes)
428 {
429  return attributes->core.type;
430 }
431 
432 static inline void psa_set_key_bits(psa_key_attributes_t *attributes,
433  size_t bits)
434 {
435  if (bits > PSA_MAX_KEY_BITS) {
436  attributes->core.bits = PSA_KEY_BITS_TOO_LARGE;
437  } else {
438  attributes->core.bits = (psa_key_bits_t) bits;
439  }
440 }
441 
442 static inline size_t psa_get_key_bits(
443  const psa_key_attributes_t *attributes)
444 {
445  return attributes->core.bits;
446 }
447 
448 #ifdef __cplusplus
449 }
450 #endif
451 
452 #endif /* PSA_CRYPTO_STRUCT_H */
PSA_KEY_USAGE_SIGN_HASH
#define PSA_KEY_USAGE_SIGN_HASH
Definition: crypto_values.h:2304
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:320
PSA_KEY_ATTRIBUTES_INIT
#define PSA_KEY_ATTRIBUTES_INIT
Definition: crypto_struct.h:311
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:386
PSA_KEY_USAGE_VERIFY_HASH
#define PSA_KEY_USAGE_VERIFY_HASH
Definition: crypto_values.h:2314
PSA_AEAD_OPERATION_INIT
#define PSA_AEAD_OPERATION_INIT
Definition: crypto_struct.h:149
psa_status_t
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:50
psa_key_policy_s::alg2
psa_algorithm_t alg2
Definition: crypto_struct.h:240
psa_aead_operation_s::block_size
uint8_t block_size
Definition: crypto_struct.h:142
psa_hash_operation_s::id
unsigned int id
Definition: crypto_struct.h:78
psa_aead_operation_s::iv_size
uint8_t iv_size
Definition: crypto_struct.h:141
psa_aead_operation_s::dummy
unsigned dummy
Definition: crypto_struct.h:144
PSA_TLS12_PRF_STATE_INIT
@ PSA_TLS12_PRF_STATE_INIT
Definition: crypto_struct.h:176
psa_cipher_operation_s::iv_set
unsigned int iv_set
Definition: crypto_struct.h:99
psa_core_key_attributes_t::policy
psa_key_policy_t policy
Definition: crypto_struct.h:292
psa_key_attributes_s
Definition: crypto_struct.h:299
psa_extend_key_usage_flags
static void psa_extend_key_usage_flags(psa_key_usage_t *usage_flags)
Definition: crypto_struct.h:368
psa_cipher_operation_init
static struct psa_cipher_operation_s psa_cipher_operation_init(void)
Definition: crypto_struct.h:107
PSA_MAC_OPERATION_INIT
#define PSA_MAC_OPERATION_INIT
Definition: crypto_struct.h:130
psa_aead_operation_s::key_set
unsigned int key_set
Definition: crypto_struct.h:139
psa_tls12_prf_key_derivation_s::label_length
size_t label_length
Definition: crypto_struct.h:202
psa_hkdf_key_derivation_t::info_length
size_t info_length
Definition: crypto_struct.h:159
PSA_TLS12_PRF_STATE_KEY_SET
@ PSA_TLS12_PRF_STATE_KEY_SET
Definition: crypto_struct.h:178
psa_hash_operation_s
Definition: crypto_struct.h:71
psa_core_key_attributes_t
Definition: crypto_struct.h:287
psa_core_key_attributes_t::type
psa_key_type_t type
Definition: crypto_struct.h:288
psa_hkdf_key_derivation_t::offset_in_block
uint8_t offset_in_block
Definition: crypto_struct.h:163
psa_tls12_prf_key_derivation_s
Definition: crypto_struct.h:183
psa_aead_operation_init
static struct psa_aead_operation_s psa_aead_operation_init(void)
Definition: crypto_struct.h:150
psa_key_policy_init
static struct psa_key_policy_s psa_key_policy_init(void)
Definition: crypto_struct.h:245
psa_driver_hash_context_t
Definition: crypto_driver_contexts_primitives.h:87
psa_tls12_prf_key_derivation_t
struct psa_tls12_prf_key_derivation_s psa_tls12_prf_key_derivation_t
psa_get_key_id
static mbedtls_svc_key_id_t psa_get_key_id(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:335
psa_tls12_prf_key_derivation_s::output_block
uint8_t output_block[PSA_HASH_MAX_SIZE]
Definition: crypto_struct.h:207
psa_key_attributes_s::core
psa_core_key_attributes_t core
Definition: crypto_struct.h:300
psa_key_derivation_s::capacity
size_t capacity
Definition: crypto_struct.h:215
PSA_KEY_LIFETIME_IS_VOLATILE
#define PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)
Definition: crypto_values.h:2054
psa_driver_cipher_context_t
Definition: crypto_driver_contexts_primitives.h:95
psa_set_key_type
static void psa_set_key_type(psa_key_attributes_t *attributes, psa_key_type_t type)
Definition: crypto_struct.h:411
psa_key_bits_t
uint16_t psa_key_bits_t
Definition: crypto_struct.h:253
psa_key_derivation_operation_init
static struct psa_key_derivation_s psa_key_derivation_operation_init(void)
Definition: crypto_struct.h:231
psa_cipher_operation_s::ctx
psa_driver_cipher_context_t ctx
Definition: crypto_struct.h:103
psa_key_derivation_s::dummy
uint8_t dummy
Definition: crypto_struct.h:218
psa_key_policy_s::alg
psa_algorithm_t alg
Definition: crypto_struct.h:239
psa_core_key_attributes_t::flags
psa_key_attributes_flag_t flags
Definition: crypto_struct.h:293
psa_get_key_bits
static size_t psa_get_key_bits(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:442
psa_key_attributes_s::domain_parameters
void * domain_parameters
Definition: crypto_struct.h:304
PSA_TLS12_PRF_STATE_LABEL_SET
@ PSA_TLS12_PRF_STATE_LABEL_SET
Definition: crypto_struct.h:179
psa_tls12_prf_key_derivation_s::seed_length
size_t seed_length
Definition: crypto_struct.h:200
PSA_TLS12_PRF_STATE_SEED_SET
@ PSA_TLS12_PRF_STATE_SEED_SET
Definition: crypto_struct.h:177
psa_aead_operation_s::alg
psa_algorithm_t alg
Definition: crypto_struct.h:138
psa_set_key_bits
static void psa_set_key_bits(psa_key_attributes_t *attributes, size_t bits)
Definition: crypto_struct.h:432
psa_tls12_prf_key_derivation_s::label
uint8_t * label
Definition: crypto_struct.h:201
psa_key_derivation_s::can_output_key
unsigned int can_output_key
Definition: crypto_struct.h:214
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION
#define PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location)
Definition: crypto_values.h:2088
PSA_KEY_LIFETIME_GET_LOCATION
#define PSA_KEY_LIFETIME_GET_LOCATION(lifetime)
Definition: crypto_values.h:2035
PSA_KEY_USAGE_SIGN_MESSAGE
#define PSA_KEY_USAGE_SIGN_MESSAGE
Definition: crypto_values.h:2284
psa_key_policy_s::usage
psa_key_usage_t usage
Definition: crypto_struct.h:238
psa_key_derivation_s::ctx
union psa_key_derivation_s::@8 ctx
psa_aead_operation_s::cipher
mbedtls_cipher_context_t cipher
Definition: crypto_struct.h:145
psa_core_key_attributes_t::bits
psa_key_bits_t bits
Definition: crypto_struct.h:289
psa_aead_operation_s::iv_set
unsigned int iv_set
Definition: crypto_struct.h:140
psa_set_key_algorithm
static void psa_set_key_algorithm(psa_key_attributes_t *attributes, psa_algorithm_t alg)
Definition: crypto_struct.h:392
psa_set_key_lifetime
static void psa_set_key_lifetime(psa_key_attributes_t *attributes, psa_key_lifetime_t lifetime)
Definition: crypto_struct.h:349
psa_aead_operation_s
Definition: crypto_struct.h:137
PSA_CIPHER_OPERATION_INIT
#define PSA_CIPHER_OPERATION_INIT
Definition: crypto_struct.h:106
psa_get_key_type
static psa_key_type_t psa_get_key_type(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:426
psa_key_derivation_s::alg
psa_algorithm_t alg
Definition: crypto_struct.h:213
psa_mac_operation_s::ctx
psa_driver_mac_context_t ctx
Definition: crypto_struct.h:127
psa_hash_operation_s::ctx
psa_driver_hash_context_t ctx
Definition: crypto_struct.h:79
psa_key_slot_number_t
uint64_t psa_key_slot_number_t
Definition: crypto_se_driver.h:136
psa_key_usage_t
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition: crypto_types.h:314
psa_hkdf_key_derivation_t::info_set
unsigned int info_set
Definition: crypto_struct.h:166
psa_cipher_operation_s
Definition: crypto_struct.h:89
psa_key_attributes_flag_t
uint16_t psa_key_attributes_flag_t
Definition: crypto_struct.h:271
psa_tls12_prf_key_derivation_s::state
psa_tls12_prf_key_derivation_state_t state
Definition: crypto_struct.h:195
PSA_KEY_DERIVATION_OPERATION_INIT
#define PSA_KEY_DERIVATION_OPERATION_INIT
Definition: crypto_struct.h:230
psa_cipher_operation_s::iv_required
unsigned int iv_required
Definition: crypto_struct.h:98
PSA_KEY_POLICY_INIT
#define PSA_KEY_POLICY_INIT
Definition: crypto_struct.h:244
psa_algorithm_t
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:125
PSA_KEY_LIFETIME_PERSISTENT
#define PSA_KEY_LIFETIME_PERSISTENT
Definition: crypto_values.h:2012
psa_mac_operation_s::mac_size
uint8_t mac_size
Definition: crypto_struct.h:125
psa_key_policy_s
Definition: crypto_struct.h:237
psa_mac_operation_init
static struct psa_mac_operation_s psa_mac_operation_init(void)
Definition: crypto_struct.h:131
mbedtls_svc_key_id_t
psa_key_id_t mbedtls_svc_key_id_t
Definition: crypto_types.h:283
psa_tls12_prf_key_derivation_s::left_in_block
uint8_t left_in_block
Definition: crypto_struct.h:190
psa_key_derivation_s::tls12_prf
psa_tls12_prf_key_derivation_t tls12_prf
Definition: crypto_struct.h:224
PSA_TLS12_PRF_STATE_OUTPUT
@ PSA_TLS12_PRF_STATE_OUTPUT
Definition: crypto_struct.h:180
PSA_HASH_MAX_SIZE
#define PSA_HASH_MAX_SIZE
Definition: crypto_sizes.h:124
psa_key_type_t
uint16_t psa_key_type_t
Encoding of a key type.
Definition: crypto_types.h:69
psa_tls12_prf_key_derivation_s::seed
uint8_t * seed
Definition: crypto_struct.h:199
psa_driver_mac_context_t
Definition: crypto_driver_contexts_composites.h:71
psa_mac_operation_s
Definition: crypto_struct.h:117
gcm.h
This file contains GCM definitions and functions.
psa_aead_operation_s::ctx
union psa_aead_operation_s::@7 ctx
PSA_MAX_KEY_BITS
#define PSA_MAX_KEY_BITS
Definition: crypto_struct.h:262
psa_core_key_attributes_t::lifetime
psa_key_lifetime_t lifetime
Definition: crypto_struct.h:290
PSA_KEY_BITS_TOO_LARGE
#define PSA_KEY_BITS_TOO_LARGE
Definition: crypto_struct.h:256
mbedtls_cipher_context_t
Definition: cipher.h:305
psa_hkdf_key_derivation_t::block_number
uint8_t block_number
Definition: crypto_struct.h:164
psa_cipher_operation_s::default_iv_length
uint8_t default_iv_length
Definition: crypto_struct.h:101
crypto_driver_contexts_composites.h
psa_key_derivation_s::hkdf
psa_hkdf_key_derivation_t hkdf
Definition: crypto_struct.h:220
psa_key_attributes_s::domain_parameters_size
size_t domain_parameters_size
Definition: crypto_struct.h:305
crypto_driver_contexts_primitives.h
psa_hkdf_key_derivation_t::info
uint8_t * info
Definition: crypto_struct.h:158
config.h
Configuration options (set of defines)
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:379
psa_mac_operation_s::id
unsigned int id
Definition: crypto_struct.h:124
PSA_HASH_OPERATION_INIT
#define PSA_HASH_OPERATION_INIT
Definition: crypto_struct.h:82
psa_get_key_algorithm
static psa_algorithm_t psa_get_key_algorithm(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:398
psa_cipher_operation_s::id
unsigned int id
Definition: crypto_struct.h:96
psa_tls12_prf_key_derivation_s::block_number
uint8_t block_number
Definition: crypto_struct.h:193
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_hash_operation_init
static struct psa_hash_operation_s psa_hash_operation_init(void)
Definition: crypto_struct.h:83
psa_hkdf_key_derivation_t
Definition: crypto_struct.h:157
psa_key_attributes_init
static struct psa_key_attributes_s psa_key_attributes_init(void)
Definition: crypto_struct.h:314
psa_get_key_lifetime
static psa_key_lifetime_t psa_get_key_lifetime(const psa_key_attributes_t *attributes)
Definition: crypto_struct.h:362
cmac.h
This file contains CMAC definitions and functions.
PSA_KEY_USAGE_VERIFY_MESSAGE
#define PSA_KEY_USAGE_VERIFY_MESSAGE
Definition: crypto_values.h:2294
psa_core_key_attributes_t::id
mbedtls_svc_key_id_t id
Definition: crypto_struct.h:291
psa_key_lifetime_t
uint32_t psa_key_lifetime_t
Definition: crypto_types.h:174
psa_hkdf_key_derivation_t::state
unsigned int state
Definition: crypto_struct.h:165
psa_tls12_prf_key_derivation_s::Ai
uint8_t Ai[PSA_HASH_MAX_SIZE]
Definition: crypto_struct.h:204
psa_tls12_prf_key_derivation_state_t
psa_tls12_prf_key_derivation_state_t
Definition: crypto_struct.h:175
psa_key_derivation_s
Definition: crypto_struct.h:212
psa_tls12_prf_key_derivation_s::secret
uint8_t * secret
Definition: crypto_struct.h:197
psa_tls12_prf_key_derivation_s::secret_length
size_t secret_length
Definition: crypto_struct.h:198
psa_mac_operation_s::is_sign
unsigned int is_sign
Definition: crypto_struct.h:126