Mbed TLS v3.6.7
Toggle main menu visibility
Loading...
Searching...
No Matches
crypto_platform.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_PLATFORM_H
22
#define PSA_CRYPTO_PLATFORM_H
23
#include "
mbedtls/private_access.h
"
24
25
/*
26
* Include the build-time configuration information header. Here, we do not
27
* include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which
28
* is basically just an alias to it. This is to ease the maintenance of the
29
* TF-PSA-Crypto repository which has a different build system and
30
* configuration.
31
*/
32
#include "
psa/build_info.h
"
33
34
/* PSA requires several types which C99 provides in stdint.h. */
35
#include <stdint.h>
36
37
#if defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
38
39
/* Building for the PSA Crypto service on a PSA platform, a key owner is a PSA
40
* partition identifier.
41
*
42
* The function psa_its_identifier_of_slot() in psa_crypto_storage.c that
43
* translates a key identifier to a key storage file name assumes that
44
* mbedtls_key_owner_id_t is a 32-bit integer. This function thus needs
45
* reworking if mbedtls_key_owner_id_t is not defined as a 32-bit integer
46
* here anymore.
47
*/
48
typedef
int32_t mbedtls_key_owner_id_t;
49
57
static
inline
int
mbedtls_key_owner_id_equal(mbedtls_key_owner_id_t id1,
58
mbedtls_key_owner_id_t id2)
59
{
60
return
id1 == id2;
61
}
62
63
#endif
/* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
64
65
/*
66
* When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is being built for SPM
67
* (Secure Partition Manager) integration which separates the code into two
68
* parts: NSPE (Non-Secure Processing Environment) and SPE (Secure Processing
69
* Environment). When building for the SPE, an additional header file should be
70
* included.
71
*/
72
#if defined(MBEDTLS_PSA_CRYPTO_SPM)
73
#define PSA_CRYPTO_SECURE 1
74
#include "crypto_spe.h"
75
#endif
// MBEDTLS_PSA_CRYPTO_SPM
76
77
#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
87
typedef
struct
{
88
uintptr_t
MBEDTLS_PRIVATE
(opaque)[2];
89
} mbedtls_psa_external_random_context_t;
90
#endif
/* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */
91
92
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
99
typedef
uint32_t mbedtls_psa_client_handle_t;
100
#endif
101
102
#endif
/* PSA_CRYPTO_PLATFORM_H */
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.
include
psa
crypto_platform.h
Generated on
for Mbed TLS v3.6.7 by
1.17.0