Mbed TLS v3.6.2
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. */
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
59typedef int32_t psa_status_t;
60#endif
61
78typedef uint16_t psa_key_type_t;
79
97typedef uint8_t psa_ecc_family_t;
98
116typedef uint8_t psa_dh_family_t;
117
134typedef uint32_t psa_algorithm_t;
135
183typedef uint32_t psa_key_lifetime_t;
184
219typedef uint8_t psa_key_persistence_t;
220
260typedef uint32_t psa_key_location_t;
261
275typedef 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 */
300typedef struct {
302 mbedtls_key_owner_id_t MBEDTLS_PRIVATE(owner);
304
305#endif /* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
306
323typedef 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. */
441typedef uint64_t psa_key_slot_number_t;
442#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
443#endif /* !__DOXYGEN_ONLY__ */
444
457
481
505
508#endif /* PSA_CRYPTO_TYPES_H */
PSA cryptography module: Mbed TLS platform definitions.
uint16_t psa_key_type_t
Encoding of a key type.
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
uint8_t psa_ecc_family_t
uint8_t psa_dh_family_t
uint16_t psa_key_derivation_step_t
Encoding of the step of a key derivation.
int32_t psa_status_t
Function return status.
uint32_t psa_key_id_t
uint8_t psa_key_persistence_t
uint32_t psa_key_location_t
uint32_t psa_key_lifetime_t
psa_key_id_t mbedtls_svc_key_id_t
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
uint64_t psa_key_slot_number_t
Macro wrapper for struct's members.
#define MBEDTLS_PRIVATE(member)
Build-time PSA configuration info.