Mbed TLS v3.6.7
Toggle main menu visibility
Loading...
Searching...
No Matches
crypto_types.h
Go to the documentation of this file.
1
16
/*
17
* Copyright The Mbed TLS Contributors
18
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
19
*/
20
21
#ifndef PSA_CRYPTO_TYPES_H
22
#define PSA_CRYPTO_TYPES_H
23
24
/*
25
* Include the build-time configuration information header. Here, we do not
26
* include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which
27
* is basically just an alias to it. This is to ease the maintenance of the
28
* TF-PSA-Crypto repository which has a different build system and
29
* configuration.
30
*/
31
#include "
psa/build_info.h
"
32
33
/* Define the MBEDTLS_PRIVATE macro. */
34
#include "
mbedtls/private_access.h
"
35
36
#if defined(MBEDTLS_PSA_CRYPTO_PLATFORM_FILE)
37
#include MBEDTLS_PSA_CRYPTO_PLATFORM_FILE
38
#else
39
#include "
crypto_platform.h
"
40
#endif
41
42
#include <stdint.h>
43
47
54
/* If #PSA_SUCCESS is already defined, it means that #psa_status_t
55
* is also defined in an external header, so prevent its multiple
56
* definition.
57
*/
58
#ifndef PSA_SUCCESS
59
typedef
int32_t
psa_status_t
;
60
#endif
61
63
67
78
typedef
uint16_t
psa_key_type_t
;
79
97
typedef
uint8_t
psa_ecc_family_t
;
98
116
typedef
uint8_t
psa_dh_family_t
;
117
134
typedef
uint32_t
psa_algorithm_t
;
135
137
141
183
typedef
uint32_t
psa_key_lifetime_t
;
184
219
typedef
uint8_t
psa_key_persistence_t
;
220
260
typedef
uint32_t
psa_key_location_t
;
261
275
typedef
uint32_t
psa_key_id_t
;
276
291
#if !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
292
typedef
psa_key_id_t
mbedtls_svc_key_id_t
;
293
294
#else
/* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
295
/* Implementation-specific: The Mbed TLS library can be built as
296
* part of a multi-client service that exposes the PSA Cryptography API in each
297
* client and encodes the client identity in the key identifier argument of
298
* functions such as psa_open_key().
299
*/
300
typedef
struct
{
301
psa_key_id_t
MBEDTLS_PRIVATE
(key_id);
302
mbedtls_key_owner_id_t
MBEDTLS_PRIVATE
(owner);
303
}
mbedtls_svc_key_id_t
;
304
305
#endif
/* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
306
308
312
323
typedef
uint32_t
psa_key_usage_t
;
324
326
330
432
typedef
struct
psa_key_attributes_s
psa_key_attributes_t
;
433
434
435
#ifndef __DOXYGEN_ONLY__
436
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
437
/* Mbed TLS defines this type in crypto_types.h because it is also
438
* visible to applications through an implementation-specific extension.
439
* For the PSA Cryptography specification, this type is only visible
440
* via crypto_se_driver.h. */
441
typedef
uint64_t
psa_key_slot_number_t
;
442
#endif
/* MBEDTLS_PSA_CRYPTO_SE_C */
443
#endif
/* !__DOXYGEN_ONLY__ */
444
446
450
456
typedef
uint16_t
psa_key_derivation_step_t
;
457
480
typedef
struct
psa_custom_key_parameters_s
psa_custom_key_parameters_t
;
481
504
typedef
struct
psa_key_production_parameters_s
psa_key_production_parameters_t
;
505
507
508
#endif
/* PSA_CRYPTO_TYPES_H */
crypto_platform.h
PSA cryptography module: Mbed TLS platform definitions.
psa_key_attributes_t
struct psa_key_attributes_s psa_key_attributes_t
Definition
crypto_types.h:432
psa_key_type_t
uint16_t psa_key_type_t
Encoding of a key type.
Definition
crypto_types.h:78
psa_algorithm_t
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition
crypto_types.h:134
psa_ecc_family_t
uint8_t psa_ecc_family_t
Definition
crypto_types.h:97
psa_dh_family_t
uint8_t psa_dh_family_t
Definition
crypto_types.h:116
psa_custom_key_parameters_t
struct psa_custom_key_parameters_s psa_custom_key_parameters_t
Custom parameters for key generation or key derivation.
Definition
crypto_types.h:480
psa_key_derivation_step_t
uint16_t psa_key_derivation_step_t
Encoding of the step of a key derivation.
Definition
crypto_types.h:456
psa_key_production_parameters_t
struct psa_key_production_parameters_s psa_key_production_parameters_t
Custom parameters for key generation or key derivation.
Definition
crypto_types.h:504
psa_status_t
int32_t psa_status_t
Function return status.
Definition
crypto_types.h:59
psa_key_id_t
uint32_t psa_key_id_t
Definition
crypto_types.h:275
psa_key_persistence_t
uint8_t psa_key_persistence_t
Definition
crypto_types.h:219
psa_key_location_t
uint32_t psa_key_location_t
Definition
crypto_types.h:260
psa_key_lifetime_t
uint32_t psa_key_lifetime_t
Definition
crypto_types.h:183
mbedtls_svc_key_id_t
psa_key_id_t mbedtls_svc_key_id_t
Definition
crypto_types.h:292
psa_key_usage_t
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition
crypto_types.h:323
psa_key_slot_number_t
uint64_t psa_key_slot_number_t
Definition
crypto_se_driver.h:137
private_access.h
Macro wrapper for struct's members.
MBEDTLS_PRIVATE
#define MBEDTLS_PRIVATE(member)
Definition
private_access.h:15
build_info.h
Build-time PSA configuration info.
psa_custom_key_parameters_s
Definition
crypto_struct.h:226
psa_key_attributes_s
Definition
crypto_struct.h:295
psa_key_production_parameters_s
Definition
crypto_struct.h:252
include
psa
crypto_types.h
Generated on
for Mbed TLS v3.6.7 by
1.17.0