|
14 | 14 | #ifndef MBEDTLS_BUILD_INFO_H |
15 | 15 | #define MBEDTLS_BUILD_INFO_H |
16 | 16 |
|
| 17 | +#include "tf-psa-crypto/build_info.h" |
| 18 | + |
17 | 19 | /* |
18 | 20 | * This set of compile-time defines can be used to determine the version number |
19 | 21 | * of the Mbed TLS library used. Run-time variables for the same can be found in |
|
37 | 39 | #define MBEDTLS_VERSION_STRING "4.0.0" |
38 | 40 | #define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 4.0.0" |
39 | 41 |
|
40 | | -/* Macros for build-time platform detection */ |
41 | | - |
42 | | -#if !defined(MBEDTLS_ARCH_IS_ARM64) && \ |
43 | | - (defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)) |
44 | | -#define MBEDTLS_ARCH_IS_ARM64 |
45 | | -#endif |
46 | | - |
47 | | -#if !defined(MBEDTLS_ARCH_IS_ARM32) && \ |
48 | | - (defined(__arm__) || defined(_M_ARM) || \ |
49 | | - defined(_M_ARMT) || defined(__thumb__) || defined(__thumb2__)) |
50 | | -#define MBEDTLS_ARCH_IS_ARM32 |
51 | | -#endif |
52 | | - |
53 | | -#if !defined(MBEDTLS_ARCH_IS_X64) && \ |
54 | | - (defined(__amd64__) || defined(__x86_64__) || \ |
55 | | - ((defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC))) |
56 | | -#define MBEDTLS_ARCH_IS_X64 |
57 | | -#endif |
58 | | - |
59 | | -#if !defined(MBEDTLS_ARCH_IS_X86) && \ |
60 | | - (defined(__i386__) || defined(_X86_) || \ |
61 | | - (defined(_M_IX86) && !defined(_M_I86))) |
62 | | -#define MBEDTLS_ARCH_IS_X86 |
63 | | -#endif |
64 | | - |
65 | | -#if !defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64) && \ |
66 | | - (defined(_M_ARM64) || defined(_M_ARM64EC)) |
67 | | -#define MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64 |
68 | | -#endif |
69 | | - |
70 | | -/* This is defined if the architecture is Armv8-A, or higher */ |
71 | | -#if !defined(MBEDTLS_ARCH_IS_ARMV8_A) |
72 | | -#if defined(__ARM_ARCH) && defined(__ARM_ARCH_PROFILE) |
73 | | -#if (__ARM_ARCH >= 8) && (__ARM_ARCH_PROFILE == 'A') |
74 | | -/* GCC, clang, armclang and IAR */ |
75 | | -#define MBEDTLS_ARCH_IS_ARMV8_A |
76 | | -#endif |
77 | | -#elif defined(__ARM_ARCH_8A) |
78 | | -/* Alternative defined by clang */ |
79 | | -#define MBEDTLS_ARCH_IS_ARMV8_A |
80 | | -#elif defined(_M_ARM64) || defined(_M_ARM64EC) |
81 | | -/* MSVC ARM64 is at least Armv8.0-A */ |
82 | | -#define MBEDTLS_ARCH_IS_ARMV8_A |
83 | | -#endif |
84 | | -#endif |
85 | | - |
86 | | -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) && !defined(__clang__) \ |
87 | | - && !defined(__llvm__) && !defined(__INTEL_COMPILER) |
88 | | -/* Defined if the compiler really is gcc and not clang, etc */ |
89 | | -#define MBEDTLS_COMPILER_IS_GCC |
90 | | -#define MBEDTLS_GCC_VERSION \ |
91 | | - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
92 | | -#endif |
93 | | - |
94 | | -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) |
95 | | -#define _CRT_SECURE_NO_DEPRECATE 1 |
96 | | -#endif |
97 | | - |
98 | | -/* Define `inline` on some non-C99-compliant compilers. */ |
99 | | -#if (defined(__ARMCC_VERSION) || defined(_MSC_VER)) && \ |
100 | | - !defined(inline) && !defined(__cplusplus) |
101 | | -#define inline __inline |
102 | | -#endif |
103 | | - |
104 | 42 | #if defined(MBEDTLS_CONFIG_FILES_READ) |
105 | 43 | #error "Something went wrong: MBEDTLS_CONFIG_FILES_READ defined before reading the config files!" |
106 | 44 | #endif |
107 | 45 | #if defined(MBEDTLS_CONFIG_IS_FINALIZED) |
108 | 46 | #error "Something went wrong: MBEDTLS_CONFIG_IS_FINALIZED defined before reading the config files!" |
109 | 47 | #endif |
110 | 48 |
|
111 | | -/* X.509, TLS and non-PSA crypto configuration */ |
| 49 | +/* X.509 and TLS configuration */ |
112 | 50 | #if !defined(MBEDTLS_CONFIG_FILE) |
113 | 51 | #include "mbedtls/mbedtls_config.h" |
114 | 52 | #else |
|
130 | 68 | #include MBEDTLS_USER_CONFIG_FILE |
131 | 69 | #endif |
132 | 70 |
|
133 | | -/* PSA crypto configuration */ |
134 | | -#if defined(TF_PSA_CRYPTO_CONFIG_FILE) |
135 | | -#include TF_PSA_CRYPTO_CONFIG_FILE |
136 | | -#else |
137 | | -#include "psa/crypto_config.h" |
138 | | -#endif |
139 | | -#if defined(TF_PSA_CRYPTO_USER_CONFIG_FILE) |
140 | | -#include TF_PSA_CRYPTO_USER_CONFIG_FILE |
141 | | -#endif |
142 | | - |
143 | 71 | /* Indicate that all configuration files have been read. |
144 | 72 | * It is now time to adjust the configuration (follow through on dependencies, |
145 | 73 | * make PSA and legacy crypto consistent, etc.). |
146 | 74 | */ |
147 | 75 | #define MBEDTLS_CONFIG_FILES_READ |
148 | 76 |
|
149 | | -/* Auto-enable MBEDTLS_CTR_DRBG_USE_128_BIT_KEY if |
150 | | - * MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH and MBEDTLS_CTR_DRBG_C defined |
151 | | - * to ensure a 128-bit key size in CTR_DRBG. |
152 | | - */ |
153 | | -#if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && defined(MBEDTLS_CTR_DRBG_C) |
154 | | -#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY |
155 | | -#endif |
156 | | - |
157 | | -/* Auto-enable MBEDTLS_MD_C if needed by a module that didn't require it |
158 | | - * in a previous release, to ensure backwards compatibility. |
159 | | - */ |
160 | | -#if defined(MBEDTLS_PKCS5_C) |
161 | | -#define MBEDTLS_MD_C |
162 | | -#endif |
163 | | - |
164 | | -/* PSA crypto specific configuration options |
165 | | - * - If config_psa.h reads a configuration option in preprocessor directive, |
166 | | - * this symbol should be set before its inclusion. (e.g. MBEDTLS_MD_C) |
167 | | - * - If config_psa.h writes a configuration option in conditional directive, |
168 | | - * this symbol should be consulted after its inclusion. |
169 | | - * (e.g. MBEDTLS_MD_LIGHT) |
170 | | - */ |
171 | | -#include "mbedtls/config_psa.h" |
172 | | - |
173 | | -#include "mbedtls/config_adjust_legacy_crypto.h" |
174 | | - |
175 | 77 | #include "mbedtls/config_adjust_x509.h" |
176 | 78 |
|
177 | 79 | #include "mbedtls/config_adjust_ssl.h" |
|
0 commit comments