Mbed TLS v3.6.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 "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 
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 
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 
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)
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 {
304 
305 #endif /* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
306 
323 typedef uint32_t psa_key_usage_t;
324 
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 
456 typedef uint16_t psa_key_derivation_step_t;
457 
481 
484 #endif /* PSA_CRYPTO_TYPES_H */
uint8_t psa_key_persistence_t
Definition: crypto_types.h:219
uint16_t psa_key_derivation_step_t
Encoding of the step of a key derivation.
Definition: crypto_types.h:456
#define MBEDTLS_PRIVATE(member)
uint32_t psa_key_id_t
Definition: crypto_types.h:275
uint8_t psa_dh_family_t
Definition: crypto_types.h:116
int32_t mbedtls_key_owner_id_t
uint32_t psa_key_location_t
Definition: crypto_types.h:260
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:134
Macro wrapper for struct's members.
PSA cryptography module: Mbed TLS platform definitions.
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition: crypto_types.h:323
uint16_t psa_key_type_t
Encoding of a key type.
Definition: crypto_types.h:78
uint32_t psa_key_lifetime_t
Definition: crypto_types.h:183
Build-time PSA configuration info.
uint8_t psa_ecc_family_t
Definition: crypto_types.h:97
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:59
uint64_t psa_key_slot_number_t
Definition: crypto_types.h:441