Mbed TLS v3.5.0
mbedtls/build_info.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright The Mbed TLS Contributors
11  * SPDX-License-Identifier: Apache-2.0
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License"); you may
14  * not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  */
25 
26 #ifndef MBEDTLS_BUILD_INFO_H
27 #define MBEDTLS_BUILD_INFO_H
28 
29 /*
30  * This set of compile-time defines can be used to determine the version number
31  * of the Mbed TLS library used. Run-time variables for the same can be found in
32  * version.h
33  */
34 
39 #define MBEDTLS_VERSION_MAJOR 3
40 #define MBEDTLS_VERSION_MINOR 5
41 #define MBEDTLS_VERSION_PATCH 0
42 
48 #define MBEDTLS_VERSION_NUMBER 0x03050000
49 #define MBEDTLS_VERSION_STRING "3.5.0"
50 #define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 3.5.0"
51 
52 /* Macros for build-time platform detection */
53 
54 #if !defined(MBEDTLS_ARCH_IS_ARM64) && \
55  (defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC))
56 #define MBEDTLS_ARCH_IS_ARM64
57 #endif
58 
59 #if !defined(MBEDTLS_ARCH_IS_ARM32) && \
60  (defined(__arm__) || defined(_M_ARM) || \
61  defined(_M_ARMT) || defined(__thumb__) || defined(__thumb2__))
62 #define MBEDTLS_ARCH_IS_ARM32
63 #endif
64 
65 #if !defined(MBEDTLS_ARCH_IS_X64) && \
66  (defined(__amd64__) || defined(__x86_64__) || \
67  ((defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)))
68 #define MBEDTLS_ARCH_IS_X64
69 #endif
70 
71 #if !defined(MBEDTLS_ARCH_IS_X86) && \
72  (defined(__i386__) || defined(_X86_) || \
73  (defined(_M_IX86) && !defined(_M_I86)))
74 #define MBEDTLS_ARCH_IS_X86
75 #endif
76 
77 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
78 #define _CRT_SECURE_NO_DEPRECATE 1
79 #endif
80 
81 /* Define `inline` on some non-C99-compliant compilers. */
82 #if (defined(__ARMCC_VERSION) || defined(_MSC_VER)) && \
83  !defined(inline) && !defined(__cplusplus)
84 #define inline __inline
85 #endif
86 
87 /* X.509, TLS and non-PSA crypto configuration */
88 #if !defined(MBEDTLS_CONFIG_FILE)
89 #include "mbedtls/mbedtls_config.h"
90 #else
91 #include MBEDTLS_CONFIG_FILE
92 #endif
93 
94 #if defined(MBEDTLS_CONFIG_VERSION) && ( \
95  MBEDTLS_CONFIG_VERSION < 0x03000000 || \
96  MBEDTLS_CONFIG_VERSION > MBEDTLS_VERSION_NUMBER)
97 #error "Invalid config version, defined value of MBEDTLS_CONFIG_VERSION is unsupported"
98 #endif
99 
100 /* Target and application specific configurations
101  *
102  * Allow user to override any previous default.
103  *
104  */
105 #if defined(MBEDTLS_USER_CONFIG_FILE)
106 #include MBEDTLS_USER_CONFIG_FILE
107 #endif
108 
109 /* PSA crypto configuration */
110 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
111 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG_FILE)
112 #include MBEDTLS_PSA_CRYPTO_CONFIG_FILE
113 #else
114 #include "psa/crypto_config.h"
115 #endif
116 #if defined(MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE)
117 #include MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE
118 #endif
119 #endif /* defined(MBEDTLS_PSA_CRYPTO_CONFIG) */
120 
121 /* Auto-enable MBEDTLS_CTR_DRBG_USE_128_BIT_KEY if
122  * MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH and MBEDTLS_CTR_DRBG_C defined
123  * to ensure a 128-bit key size in CTR_DRBG.
124  */
125 #if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && defined(MBEDTLS_CTR_DRBG_C)
126 #define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
127 #endif
128 
129 /* Auto-enable MBEDTLS_MD_C if needed by a module that didn't require it
130  * in a previous release, to ensure backwards compatibility.
131  */
132 #if defined(MBEDTLS_PKCS5_C)
133 #define MBEDTLS_MD_C
134 #endif
135 
136 /* PSA crypto specific configuration options
137  * - If config_psa.h reads a configuration option in preprocessor directive,
138  * this symbol should be set before its inclusion. (e.g. MBEDTLS_MD_C)
139  * - If config_psa.h writes a configuration option in conditional directive,
140  * this symbol should be consulted after its inclusion.
141  * (e.g. MBEDTLS_MD_LIGHT)
142  */
143 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) /* PSA_WANT_xxx influences MBEDTLS_xxx */ || \
144  defined(MBEDTLS_PSA_CRYPTO_C) /* MBEDTLS_xxx influences PSA_WANT_xxx */
145 #include "mbedtls/config_psa.h"
146 #endif
147 
149 
151 
153 
154 /* Make sure all configuration symbols are set before including check_config.h,
155  * even the ones that are calculated programmatically. */
156 #include "mbedtls/check_config.h"
157 
158 #endif /* MBEDTLS_BUILD_INFO_H */
Consistency checks for configuration options.
Adjust legacy configuration configuration.
Adjust TLS configuration.
Adjust X.509 configuration.
PSA crypto configuration options (set of defines)
PSA crypto configuration options (set of defines)
Configuration options (set of defines)