blob: d4887d66011098ce3a4d559416e0611bb375585a [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
Bence Szépkútibb0cfeb2021-05-28 09:42:25 +02002 * \file mbedtls_config.h
Paul Bakker5121ce52009-01-03 21:22:43 +00003 *
Paul Bakker37ca75d2011-01-06 12:28:03 +00004 * \brief Configuration options (set of defines)
5 *
Simon Butcher5b331b92016-01-03 16:14:14 +00006 * This set of compile-time options may be used to enable
7 * or disable features selectively, and reduce the global
8 * memory footprint.
Darryl Greena40a1012018-01-05 15:33:17 +00009 */
10/*
Bence Szépkúti1e148272020-08-07 13:07:28 +020011 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000012 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Manuel Pégourié-Gonnarde2b0efe2015-08-11 10:38:37 +020013 */
14
Bence Szépkúti2bb74562021-06-21 16:19:00 +020015/**
Tom Cosgrove1e211442022-05-26 11:51:00 +010016 * This is an optional version symbol that enables compatibility handling of
Bence Szépkúti2bb74562021-06-21 16:19:00 +020017 * config files.
18 *
Bence Szépkúti1b2a8832021-06-28 10:26:11 +010019 * It is equal to the #MBEDTLS_VERSION_NUMBER of the Mbed TLS version that
Bence Szépkúti2bb74562021-06-21 16:19:00 +020020 * introduced the config format we want to be compatible with.
21 */
Bence Szépkúti1cafe5c2021-06-22 09:30:08 +020022//#define MBEDTLS_CONFIG_VERSION 0x03000000
Bence Szépkútiba7248a2021-05-31 16:53:56 +020023
Paul Bakkerf3b86c12011-01-27 15:24:17 +000024/**
Paul Bakker0a62cd12011-01-21 11:00:08 +000025 * \name SECTION: System support
26 *
27 * This section sets system specific settings.
28 * \{
29 */
30
Paul Bakkerf3b86c12011-01-27 15:24:17 +000031/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020032 * \def MBEDTLS_HAVE_ASM
Paul Bakkerf3b86c12011-01-27 15:24:17 +000033 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020034 * The compiler has support for asm().
Paul Bakker68041ec2009-04-19 21:17:55 +000035 *
36 * Requires support for asm() in compiler.
37 *
38 * Used in:
Dave Rodgmancb0f2c42022-12-23 13:15:37 +000039 * library/aesni.h
Manuel Pégourié-Gonnard26b54fa2018-02-27 12:20:20 +010040 * library/aria.c
Chris Jones4c5819c2021-03-03 17:45:34 +000041 * library/bn_mul.h
Dave Rodgmancb0f2c42022-12-23 13:15:37 +000042 * library/constant_time.c
Paul Bakker68041ec2009-04-19 21:17:55 +000043 *
Manuel Pégourié-Gonnard26b54fa2018-02-27 12:20:20 +010044 * Required by:
Tom Cosgrovef586aa22023-03-20 14:45:27 +000045 * MBEDTLS_AESCE_C
Gilles Peskine0bfccfa2023-03-16 17:49:44 +010046 * MBEDTLS_AESNI_C (on some platforms)
Manuel Pégourié-Gonnard26b54fa2018-02-27 12:20:20 +010047 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020048 * Comment to disable the use of assembly code.
Paul Bakker5121ce52009-01-03 21:22:43 +000049 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020050#define MBEDTLS_HAVE_ASM
Paul Bakker5121ce52009-01-03 21:22:43 +000051
Paul Bakkerf3b86c12011-01-27 15:24:17 +000052/**
Gilles Peskineed942f82017-06-08 15:19:20 +020053 * \def MBEDTLS_NO_UDBL_DIVISION
54 *
55 * The platform lacks support for double-width integer division (64-bit
56 * division on a 32-bit platform, 128-bit division on a 64-bit platform).
57 *
58 * Used in:
59 * include/mbedtls/bignum.h
60 * library/bignum.c
61 *
62 * The bignum code uses double-width division to speed up some operations.
63 * Double-width division is often implemented in software that needs to
64 * be linked with the program. The presence of a double-width integer
65 * type is usually detected automatically through preprocessor macros,
66 * but the automatic detection cannot know whether the code needs to
67 * and can be linked with an implementation of division for that type.
68 * By default division is assumed to be usable if the type is present.
69 * Uncomment this option to prevent the use of double-width division.
70 *
71 * Note that division for the native integer type is always required.
72 * Furthermore, a 64-bit type is always required even on a 32-bit
Andres Amaya Garcia2801d002017-07-21 10:56:22 +010073 * platform, but it need not support multiplication or division. In some
74 * cases it is also desirable to disable some double-width operations. For
75 * example, if double-width division is implemented in software, disabling
76 * it can reduce code size in some embedded targets.
Gilles Peskineed942f82017-06-08 15:19:20 +020077 */
78//#define MBEDTLS_NO_UDBL_DIVISION
79
80/**
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +020081 * \def MBEDTLS_NO_64BIT_MULTIPLICATION
82 *
83 * The platform lacks support for 32x32 -> 64-bit multiplication.
84 *
85 * Used in:
86 * library/poly1305.c
87 *
88 * Some parts of the library may use multiplication of two unsigned 32-bit
89 * operands with a 64-bit result in order to speed up computations. On some
90 * platforms, this is not available in hardware and has to be implemented in
91 * software, usually in a library provided by the toolchain.
92 *
93 * Sometimes it is not desirable to have to link to that library. This option
94 * removes the dependency of that library on platforms that lack a hardware
95 * 64-bit multiplier by embedding a software implementation in Mbed TLS.
96 *
97 * Note that depending on the compiler, this may decrease performance compared
98 * to using the library function provided by the toolchain.
99 */
100//#define MBEDTLS_NO_64BIT_MULTIPLICATION
101
102/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200103 * \def MBEDTLS_HAVE_SSE2
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000104 *
Paul Bakkere23c3152012-10-01 14:42:47 +0000105 * CPU supports SSE2 instruction set.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000106 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000107 * Uncomment if the CPU supports SSE2 (IA-32 specific).
Paul Bakker5121ce52009-01-03 21:22:43 +0000108 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200109//#define MBEDTLS_HAVE_SSE2
Paul Bakkerfa9b1002013-07-03 15:31:03 +0200110
Andrzej Kurek38d4fdd2021-12-28 16:22:52 +0100111/** \} name SECTION: System support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000112
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000113/**
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200114 * \name SECTION: Mbed TLS feature support
Paul Bakker0a62cd12011-01-21 11:00:08 +0000115 *
116 * This section sets support for features that are or are not needed
117 * within the modules that are enabled.
118 * \{
119 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000120
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000121/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200122 * \def MBEDTLS_TIMING_ALT
Paul Bakkerf2561b32014-02-06 15:11:55 +0100123 *
TRodziewiczd8540832021-06-10 15:16:50 +0200124 * Uncomment to provide your own alternate implementation for
Manuel Pégourié-Gonnarda63bc942015-05-14 18:22:47 +0200125 * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay()
Paul Bakkerf2561b32014-02-06 15:11:55 +0100126 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200127 * Only works if you have MBEDTLS_TIMING_C enabled.
Paul Bakkerf2561b32014-02-06 15:11:55 +0100128 *
129 * You will need to provide a header "timing_alt.h" and an implementation at
130 * compile time.
131 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200132//#define MBEDTLS_TIMING_ALT
Paul Bakkerf2561b32014-02-06 15:11:55 +0100133
Paul Bakker90995b52013-06-24 19:20:35 +0200134/**
Manuel Pégourié-Gonnard8ba88f02015-06-22 12:14:20 +0200135 * \def MBEDTLS_ENTROPY_HARDWARE_ALT
Manuel Pégourié-Gonnard3f77dfb2015-06-19 10:06:21 +0200136 *
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200137 * Uncomment this macro to let Mbed TLS use your own implementation of a
Manuel Pégourié-Gonnard3f77dfb2015-06-19 10:06:21 +0200138 * hardware entropy collector.
139 *
140 * Your function must be called \c mbedtls_hardware_poll(), have the same
Chris Jones3848e312021-03-11 16:17:59 +0000141 * prototype as declared in library/entropy_poll.h, and accept NULL as first
142 * argument.
Manuel Pégourié-Gonnard3f77dfb2015-06-19 10:06:21 +0200143 *
144 * Uncomment to use your own hardware entropy collector.
145 */
146//#define MBEDTLS_ENTROPY_HARDWARE_ALT
147
148/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200149 * \def MBEDTLS_AES_ROM_TABLES
Paul Bakker15566e42011-04-24 21:19:15 +0000150 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100151 * Use precomputed AES tables stored in ROM.
Paul Bakker15566e42011-04-24 21:19:15 +0000152 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100153 * Uncomment this macro to use precomputed AES tables stored in ROM.
154 * Comment this macro to generate AES tables in RAM at runtime.
155 *
Hanno Becker4c1dc3c2018-03-27 16:52:03 +0100156 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
157 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
Hanno Becker6a92ce62018-03-28 11:42:05 +0100158 * initialization time before the first AES operation can be performed.
159 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
160 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
161 * performance if ROM access is slower than RAM access.
Hanno Becker177d3cf2017-06-07 15:52:48 +0100162 *
163 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
Paul Bakker15566e42011-04-24 21:19:15 +0000164 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200165//#define MBEDTLS_AES_ROM_TABLES
Paul Bakker15566e42011-04-24 21:19:15 +0000166
167/**
Hanno Becker177d3cf2017-06-07 15:52:48 +0100168 * \def MBEDTLS_AES_FEWER_TABLES
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200169 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100170 * Use less ROM/RAM for AES tables.
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200171 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100172 * Uncommenting this macro omits 75% of the AES tables from
173 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
174 * by computing their values on the fly during operations
175 * (the tables are entry-wise rotations of one another).
176 *
177 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
Hanno Becker08a5c182017-06-19 16:33:58 +0100178 * by ~6kb but at the cost of more arithmetic operations during
Hanno Becker177d3cf2017-06-07 15:52:48 +0100179 * runtime. Specifically, one has to compare 4 accesses within
180 * different tables to 4 accesses with additional arithmetic
181 * operations within the same table. The performance gain/loss
182 * depends on the system and memory details.
183 *
184 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200185 */
Hanno Becker177d3cf2017-06-07 15:52:48 +0100186//#define MBEDTLS_AES_FEWER_TABLES
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200187
188/**
Arto Kinnunen732ca322023-04-14 14:26:10 +0800189 * \def MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH
190 *
191 * Use only 128-bit keys in AES operations to save ROM.
192 *
Yanray Wangd2ae4322023-05-10 10:45:38 +0800193 * Uncomment this macro to remove support for AES operations that use 192-
Arto Kinnunen732ca322023-04-14 14:26:10 +0800194 * or 256-bit keys.
195 *
Yanray Wangd2ae4322023-05-10 10:45:38 +0800196 * Uncommenting this macro reduces the size of AES code by ~300 bytes
197 * on v8-M/Thumb2.
Arto Kinnunen732ca322023-04-14 14:26:10 +0800198 *
Arto Kinnunen732ca322023-04-14 14:26:10 +0800199 * Module: library/aes.c
200 *
201 * Requires: MBEDTLS_AES_C
Arto Kinnunen732ca322023-04-14 14:26:10 +0800202 */
203//#define MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH
204
Gilles Peskinea8861e02023-09-05 20:20:51 +0200205/*
206 * Disable plain C implementation for AES.
207 *
208 * When the plain C implementation is enabled, and an implementation using a
209 * special CPU feature (such as MBEDTLS_AESCE_C) is also enabled, runtime
210 * detection will be used to select between them.
211 *
212 * If only one implementation is present, runtime detection will not be used.
213 * This configuration will crash at runtime if running on a CPU without the
214 * necessary features. It will not build unless at least one of MBEDTLS_AESCE_C
215 * and/or MBEDTLS_AESNI_C is enabled & present in the build.
216 */
217//#define MBEDTLS_AES_USE_HARDWARE_ONLY
218
Arto Kinnunen732ca322023-04-14 14:26:10 +0800219/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200220 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
Manuel Pégourié-Gonnard62edcc82015-04-03 16:28:19 +0200221 *
222 * Use less ROM for the Camellia implementation (saves about 768 bytes).
223 *
224 * Uncomment this macro to use less memory for Camellia.
225 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200226//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
Manuel Pégourié-Gonnard62edcc82015-04-03 16:28:19 +0200227
228/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200229 * \def MBEDTLS_CIPHER_MODE_CBC
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200230 *
231 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
232 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200233#define MBEDTLS_CIPHER_MODE_CBC
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200234
235/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200236 * \def MBEDTLS_CIPHER_MODE_CFB
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000237 *
238 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
239 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200240#define MBEDTLS_CIPHER_MODE_CFB
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000241
242/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200243 * \def MBEDTLS_CIPHER_MODE_CTR
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000244 *
245 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
246 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200247#define MBEDTLS_CIPHER_MODE_CTR
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000248
249/**
Jaeden Ameroff2f4932018-06-14 11:38:50 +0100250 * \def MBEDTLS_CIPHER_MODE_OFB
251 *
252 * Enable Output Feedback mode (OFB) for symmetric ciphers.
253 */
254#define MBEDTLS_CIPHER_MODE_OFB
255
256/**
257 * \def MBEDTLS_CIPHER_MODE_XTS
258 *
259 * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES.
260 */
261#define MBEDTLS_CIPHER_MODE_XTS
262
263/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200264 * \def MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +0000265 *
266 * Enable NULL cipher.
267 * Warning: Only do so when you know what you are doing. This allows for
268 * encryption or channels without any security!
269 *
Ronald Croncee42702021-04-26 11:34:44 +0200270 * To enable the following ciphersuites:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200271 * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
272 * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
273 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
274 * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
275 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
276 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
277 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
278 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
279 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
280 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
281 * MBEDTLS_TLS_RSA_WITH_NULL_SHA256
282 * MBEDTLS_TLS_RSA_WITH_NULL_SHA
283 * MBEDTLS_TLS_RSA_WITH_NULL_MD5
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200284 * MBEDTLS_TLS_PSK_WITH_NULL_SHA384
285 * MBEDTLS_TLS_PSK_WITH_NULL_SHA256
286 * MBEDTLS_TLS_PSK_WITH_NULL_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000287 *
288 * Uncomment this macro to enable the NULL cipher and ciphersuites
Paul Bakkerfab5c822012-02-06 16:45:10 +0000289 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200290//#define MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +0000291
292/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100293 * \def MBEDTLS_CIPHER_PADDING_PKCS7
Paul Bakker48e93c82013-08-14 12:21:18 +0200294 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100295 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
296 * specific padding modes in the cipher layer with cipher modes that support
297 * padding (e.g. CBC)
Paul Bakker48e93c82013-08-14 12:21:18 +0200298 *
299 * If you disable all padding modes, only full blocks can be used with CBC.
300 *
301 * Enable padding modes in the cipher layer.
302 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200303#define MBEDTLS_CIPHER_PADDING_PKCS7
304#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
305#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
306#define MBEDTLS_CIPHER_PADDING_ZEROS
Paul Bakker48e93c82013-08-14 12:21:18 +0200307
Gilles Peskine1540e5b2019-10-03 14:21:14 +0200308/** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
309 *
310 * Uncomment this macro to use a 128-bit key in the CTR_DRBG module.
Yanray Wang55ef22c2023-06-15 09:57:06 +0800311 * Without this, CTR_DRBG uses a 256-bit key
312 * unless \c MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH is set.
Gilles Peskine1540e5b2019-10-03 14:21:14 +0200313 */
314//#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
315
Paul Bakker48e93c82013-08-14 12:21:18 +0200316/**
Gilles Peskinea8861e02023-09-05 20:20:51 +0200317 * Enable the verified implementations of ECDH primitives from Project Everest
318 * (currently only Curve25519). This feature changes the layout of ECDH
319 * contexts and therefore is a compatibility break for applications that access
320 * fields of a mbedtls_ecdh_context structure directly. See also
321 * MBEDTLS_ECDH_LEGACY_CONTEXT in include/mbedtls/ecdh.h.
Dave Rodgman9eb2abd2023-11-08 11:36:00 +0000322 *
323 * The Everest code is provided under the Apache 2.0 license only; therefore enabling this
324 * option is not compatible with taking the library under the GPL v2.0-or-later license.
Gilles Peskinea8861e02023-09-05 20:20:51 +0200325 */
326//#define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED
327
328/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100329 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200330 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100331 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
332 * module. By default all supported curves are enabled.
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200333 *
334 * Comment macros to disable the curve and functions for it
335 */
Gilles Peskine799e5762018-09-14 17:34:00 +0200336/* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200337#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
338#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
339#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
340#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
341#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
342#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
343#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
344#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
345#define MBEDTLS_ECP_DP_BP256R1_ENABLED
346#define MBEDTLS_ECP_DP_BP384R1_ENABLED
347#define MBEDTLS_ECP_DP_BP512R1_ENABLED
Gilles Peskine799e5762018-09-14 17:34:00 +0200348/* Montgomery curves (supporting ECP) */
Manuel Pégourié-Gonnard07894332015-06-23 00:18:41 +0200349#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
Nicholas Wilson08f3ef12015-11-10 13:10:01 +0000350#define MBEDTLS_ECP_DP_CURVE448_ENABLED
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200351
352/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200353 * \def MBEDTLS_ECP_NIST_OPTIM
Manuel Pégourié-Gonnardc04c5302013-10-23 16:11:52 +0200354 *
355 * Enable specific 'modulo p' routines for each NIST prime.
356 * Depending on the prime and architecture, makes operations 4 to 8 times
357 * faster on the corresponding curve.
358 *
359 * Comment this macro to disable NIST curves optimisation.
360 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200361#define MBEDTLS_ECP_NIST_OPTIM
Manuel Pégourié-Gonnardc04c5302013-10-23 16:11:52 +0200362
363/**
Manuel Pégourié-Gonnard4b9c51e2017-04-20 15:50:26 +0200364 * \def MBEDTLS_ECP_RESTARTABLE
Manuel Pégourié-Gonnardc3a3bc72017-03-22 11:17:51 +0100365 *
366 * Enable "non-blocking" ECC operations that can return early and be resumed.
367 *
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +0200368 * This allows various functions to pause by returning
369 * #MBEDTLS_ERR_ECP_IN_PROGRESS (or, for functions in the SSL module,
370 * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) and then be called later again in
371 * order to further progress and eventually complete their operation. This is
372 * controlled through mbedtls_ecp_set_max_ops() which limits the maximum
373 * number of ECC operations a function may perform before pausing; see
374 * mbedtls_ecp_set_max_ops() for more information.
Manuel Pégourié-Gonnardc3a3bc72017-03-22 11:17:51 +0100375 *
Manuel Pégourié-Gonnard8b7b96b2017-08-23 10:02:51 +0200376 * This is useful in non-threaded environments if you want to avoid blocking
Manuel Pégourié-Gonnardf0bbd7e2018-10-15 13:22:41 +0200377 * for too long on ECC (and, hence, X.509 or SSL/TLS) operations.
Manuel Pégourié-Gonnardc3a3bc72017-03-22 11:17:51 +0100378 *
Manuel Pégourié-Gonnard2b7ad642022-12-06 10:42:44 +0100379 * This option:
380 * - Adds xxx_restartable() variants of existing operations in the
381 * following modules, with corresponding restart context types:
Manuel Pégourié-Gonnardb2812cc2022-12-09 09:53:55 +0100382 * - ECP (for Short Weierstrass curves only): scalar multiplication (mul),
383 * linear combination (muladd);
Manuel Pégourié-Gonnard2b7ad642022-12-06 10:42:44 +0100384 * - ECDSA: signature generation & verification;
385 * - PK: signature generation & verification;
386 * - X509: certificate chain verification.
387 * - Adds mbedtls_ecdh_enable_restart() in the ECDH module.
388 * - Changes the behaviour of TLS 1.2 clients (not servers) when using the
389 * ECDHE-ECDSA key exchange (not other key exchanges) to make all ECC
390 * computations restartable:
Manuel Pégourié-Gonnard2b7ad642022-12-06 10:42:44 +0100391 * - verification of the server's key exchange signature;
392 * - verification of the server's certificate chain;
Manuel Pégourié-Gonnardb2812cc2022-12-09 09:53:55 +0100393 * - generation of the client's signature if client authentication is used,
394 * with an ECC key/certificate.
Manuel Pégourié-Gonnard2b7ad642022-12-06 10:42:44 +0100395 *
396 * \note In the cases above, the usual SSL/TLS functions, such as
397 * mbedtls_ssl_handshake(), can now return
398 * MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS.
Ron Eldor5ed8c1e2018-11-05 14:04:26 +0200399 *
Janos Follath277bba82024-11-19 16:14:00 +0000400 * \note When this option is enabled, restartable operations in PK, X.509
401 * and TLS (see above) are not using PSA. On the other hand, ECDH
402 * computations in TLS are using PSA, and are not restartable. These
Janos Follath2761d182024-12-02 13:58:15 +0000403 * are temporary limitations that should be lifted in the future. (See
404 * https://github.com/Mbed-TLS/mbedtls/issues/9784 and
405 * https://github.com/Mbed-TLS/mbedtls/issues/9817)
Ron Eldor5ed8c1e2018-11-05 14:04:26 +0200406 *
Manuel Pégourié-Gonnardad45c4d2022-12-06 13:20:06 +0100407 * Requires: MBEDTLS_ECP_C
408 *
Manuel Pégourié-Gonnard2b7ad642022-12-06 10:42:44 +0100409 * Uncomment this macro to enable restartable ECC computations.
Manuel Pégourié-Gonnardc3a3bc72017-03-22 11:17:51 +0100410 */
Manuel Pégourié-Gonnardc9e16a92017-08-15 14:30:59 +0200411//#define MBEDTLS_ECP_RESTARTABLE
Manuel Pégourié-Gonnardc3a3bc72017-03-22 11:17:51 +0100412
413/**
Gilles Peskinea8861e02023-09-05 20:20:51 +0200414 * Uncomment to enable using new bignum code in the ECC modules.
415 *
416 * \warning This is currently experimental, incomplete and therefore should not
417 * be used in production.
418 */
419//#define MBEDTLS_ECP_WITH_MPI_UINT
420
421/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200422 * \def MBEDTLS_ECDSA_DETERMINISTIC
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100423 *
424 * Enable deterministic ECDSA (RFC 6979).
425 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
426 * may result in a compromise of the long-term signing key. This is avoided by
427 * the deterministic variant.
428 *
John Durkop36a82e52020-10-26 09:39:05 -0700429 * Requires: MBEDTLS_HMAC_DRBG_C, MBEDTLS_ECDSA_C
Manuel Pégourié-Gonnard5b1a5732014-01-07 16:46:17 +0100430 *
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100431 * Comment this macro to disable deterministic ECDSA.
432 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200433#define MBEDTLS_ECDSA_DETERMINISTIC
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100434
435/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200436 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200437 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200438 * Enable the PSK based ciphersuite modes in SSL / TLS.
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200439 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200440 * This enables the following ciphersuites (if other requisites are
441 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200442 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
443 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
444 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
445 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
446 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
447 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
448 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
449 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
450 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
451 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200452 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200453#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200454
455/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200456 * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200457 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200458 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200459 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200460 * Requires: MBEDTLS_DHM_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200461 *
462 * This enables the following ciphersuites (if other requisites are
463 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200464 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
465 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
466 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
467 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
468 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
469 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
470 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
471 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
472 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
473 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
Hanno Beckera2f6b722017-09-28 10:33:29 +0100474 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100475 * \warning Using DHE constitutes a security risk as it
476 * is not possible to validate custom DH parameters.
477 * If possible, it is recommended users should consider
478 * preferring other methods of key exchange.
479 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100480 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200481 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200482#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200483
484/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200485 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200486 *
487 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
488 *
Janos Follath277bba82024-11-19 16:14:00 +0000489 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200490 *
491 * This enables the following ciphersuites (if other requisites are
492 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200493 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
494 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
495 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
496 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
497 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
498 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200499 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200500#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200501
502/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200503 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200504 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200505 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200506 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200507 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
508 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200509 *
510 * This enables the following ciphersuites (if other requisites are
511 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200512 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
513 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
514 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
515 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
516 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
517 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
518 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
519 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
520 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
521 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
522 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
523 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
Paul Bakkere07f41d2013-04-19 09:08:57 +0200524 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200525#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200526
527/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200528 * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200529 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200530 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200531 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200532 * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
533 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200534 *
535 * This enables the following ciphersuites (if other requisites are
536 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200537 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
538 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
539 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
540 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
541 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
542 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
543 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
544 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
545 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
546 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
547 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
548 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
Hanno Beckera2f6b722017-09-28 10:33:29 +0100549 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100550 * \warning Using DHE constitutes a security risk as it
551 * is not possible to validate custom DH parameters.
552 * If possible, it is recommended users should consider
553 * preferring other methods of key exchange.
554 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100555 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200556 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200557#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200558
559/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200560 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200561 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200562 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200563 *
Janos Follath277bba82024-11-19 16:14:00 +0000564 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200565 * MBEDTLS_RSA_C
566 * MBEDTLS_PKCS1_V15
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200567 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200568 *
569 * This enables the following ciphersuites (if other requisites are
570 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200571 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
572 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
573 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
574 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
575 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
576 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
577 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
578 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
579 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
580 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakkere07f41d2013-04-19 09:08:57 +0200581 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200582#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200583
584/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200585 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200586 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200587 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200588 *
Janos Follath277bba82024-11-19 16:14:00 +0000589 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
590 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200591 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200592 *
593 * This enables the following ciphersuites (if other requisites are
594 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200595 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
596 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
597 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
598 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
599 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
600 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
601 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
602 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
603 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
604 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200605 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200606#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200607
608/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200609 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100610 *
611 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
612 *
Janos Follath277bba82024-11-19 16:14:00 +0000613 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
614 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200615 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100616 *
617 * This enables the following ciphersuites (if other requisites are
618 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200619 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
620 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
621 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
622 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
623 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
624 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
625 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
626 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
627 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
628 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100629 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200630#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100631
632/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200633 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100634 *
635 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
636 *
Janos Follath277bba82024-11-19 16:14:00 +0000637 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200638 * MBEDTLS_RSA_C
639 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100640 *
641 * This enables the following ciphersuites (if other requisites are
642 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200643 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
644 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
645 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
646 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
647 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
648 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
649 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
650 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
651 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
652 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100653 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200654#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100655
656/**
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200657 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
658 *
659 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
660 *
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +0200661 * \warning This is currently experimental. EC J-PAKE support is based on the
662 * Thread v1.0.0 specification; incompatible changes to the specification
663 * might still happen. For this reason, this is disabled by default.
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200664 *
Janos Follath277bba82024-11-19 16:14:00 +0000665 * Requires: MBEDTLS_ECJPAKE_C or PSA_WANT_ALG_JPAKE
Manuel Pégourié-Gonnard41bc8b62023-03-14 23:59:24 +0100666 * SHA-256 (via MBEDTLS_SHA256_C or a PSA driver)
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200667 * MBEDTLS_ECP_DP_SECP256R1_ENABLED
668 *
669 * This enables the following ciphersuites (if other requisites are
670 * enabled as well):
671 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
672 */
Manuel Pégourié-Gonnardcf828932015-10-20 14:57:00 +0200673//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200674
675/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200676 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
Manuel Pégourié-Gonnard6fac3512014-03-19 16:39:52 +0100677 *
678 * Enhance support for reading EC keys using variants of SEC1 not allowed by
679 * RFC 5915 and RFC 5480.
680 *
681 * Currently this means parsing the SpecifiedECDomain choice of EC
682 * parameters (only known groups are supported, not arbitrary domains, to
683 * avoid validation issues).
684 *
685 * Disable if you only need to support RFC 5915 + 5480 key formats.
686 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200687#define MBEDTLS_PK_PARSE_EC_EXTENDED
Manuel Pégourié-Gonnard6fac3512014-03-19 16:39:52 +0100688
689/**
Valerio Settiaddeee42023-06-14 10:46:55 +0200690 * \def MBEDTLS_PK_PARSE_EC_COMPRESSED
691 *
692 * Enable the support for parsing public keys of type Short Weierstrass
693 * (MBEDTLS_ECP_DP_SECP_XXX and MBEDTLS_ECP_DP_BP_XXX) which are using the
Valerio Setti3cd4ef72023-06-19 11:35:10 +0200694 * compressed point format. This parsing is done through ECP module's functions.
695 *
696 * \note As explained in the description of MBEDTLS_ECP_PF_COMPRESSED (in ecp.h)
697 * the only unsupported curves are MBEDTLS_ECP_DP_SECP224R1 and
698 * MBEDTLS_ECP_DP_SECP224K1.
Valerio Settiaddeee42023-06-14 10:46:55 +0200699 */
700#define MBEDTLS_PK_PARSE_EC_COMPRESSED
701
702/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200703 * \def MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100704 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200705 * Enable a dummy error function to make use of mbedtls_strerror() in
706 * third party libraries easier when MBEDTLS_ERROR_C is disabled
707 * (no effect when MBEDTLS_ERROR_C is enabled).
Manuel Pégourié-Gonnarddc16aa72014-06-25 12:55:12 +0200708 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200709 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
710 * not using mbedtls_strerror() or error_strerror() in your application.
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100711 *
712 * Disable if you run into name conflicts and want to really remove the
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200713 * mbedtls_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100714 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200715#define MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100716
717/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200718 * \def MBEDTLS_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000719 *
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200720 * Enable the prime-number generation code.
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200721 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200722 * Requires: MBEDTLS_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000723 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200724#define MBEDTLS_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000725
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000726/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200727 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
Paul Bakker43655f42011-12-15 20:11:16 +0000728 *
TRodziewicz15a7b732021-06-16 11:22:53 +0200729 * Do not add default entropy sources in mbedtls_entropy_init().
Paul Bakker43655f42011-12-15 20:11:16 +0000730 *
Shuo Chen95a0d112014-04-04 21:04:40 -0700731 * This is useful to have more control over the added entropy sources in an
Paul Bakker43655f42011-12-15 20:11:16 +0000732 * application.
733 *
734 * Uncomment this macro to prevent loading of default entropy functions.
Paul Bakker43655f42011-12-15 20:11:16 +0000735 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200736//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
Paul Bakker43655f42011-12-15 20:11:16 +0000737
738/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200739 * \def MBEDTLS_NO_PLATFORM_ENTROPY
Paul Bakker6083fd22011-12-03 21:45:14 +0000740 *
741 * Do not use built-in platform entropy functions.
742 * This is useful if your platform does not support
743 * standards like the /dev/urandom or Windows CryptoAPI.
744 *
745 * Uncomment this macro to disable the built-in platform entropy functions.
Paul Bakker6083fd22011-12-03 21:45:14 +0000746 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200747//#define MBEDTLS_NO_PLATFORM_ENTROPY
Paul Bakker6083fd22011-12-03 21:45:14 +0000748
749/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200750 * \def MBEDTLS_ENTROPY_FORCE_SHA256
Paul Bakker2ceda572014-02-06 15:55:25 +0100751 *
752 * Force the entropy accumulator to use a SHA-256 accumulator instead of the
753 * default SHA-512 based one (if both are available).
754 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200755 * Requires: MBEDTLS_SHA256_C
Paul Bakker2ceda572014-02-06 15:55:25 +0100756 *
757 * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
758 * if you have performance concerns.
759 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200760 * This option is only useful if both MBEDTLS_SHA256_C and
761 * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
Paul Bakker2ceda572014-02-06 15:55:25 +0100762 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200763//#define MBEDTLS_ENTROPY_FORCE_SHA256
Paul Bakker2ceda572014-02-06 15:55:25 +0100764
765/**
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100766 * \def MBEDTLS_ENTROPY_NV_SEED
767 *
768 * Enable the non-volatile (NV) seed file-based entropy source.
769 * (Also enables the NV seed read/write functions in the platform layer)
770 *
771 * This is crucial (if not required) on systems that do not have a
772 * cryptographic entropy source (in hardware or kernel) available.
773 *
774 * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
775 *
Paul Bakker71a597a2016-06-07 10:59:03 +0100776 * \note The read/write functions that are used by the entropy source are
777 * determined in the platform layer, and can be modified at runtime and/or
778 * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
779 *
780 * \note If you use the default implementation functions that read a seedfile
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100781 * with regular fopen(), please make sure you make a seedfile with the
782 * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
783 * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
Paul Bakker71a597a2016-06-07 10:59:03 +0100784 * and written to or you will get an entropy source error! The default
785 * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
786 * bytes from the file.
787 *
788 * \note The entropy collector will write to the seed file before entropy is
789 * given to an external source, to update it.
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100790 */
791//#define MBEDTLS_ENTROPY_NV_SEED
792
Ronald Cron71016a92020-08-28 19:01:50 +0200793/* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
Gilles Peskine69d7c8b2019-02-19 14:00:31 +0100794 *
Ronald Cron71016a92020-08-28 19:01:50 +0200795 * Enable key identifiers that encode a key owner identifier.
Gilles Peskine69d7c8b2019-02-19 14:00:31 +0100796 *
Ronald Cron9a2511e2020-09-14 10:02:56 +0200797 * The owner of a key is identified by a value of type ::mbedtls_key_owner_id_t
798 * which is currently hard-coded to be int32_t.
Gilles Peskine69d7c8b2019-02-19 14:00:31 +0100799 *
800 * Note that this option is meant for internal use only and may be removed
Andrzej Kurekcfc920a2022-01-25 06:33:08 -0500801 * without notice.
Gilles Peskine69d7c8b2019-02-19 14:00:31 +0100802 */
Ronald Cron71016a92020-08-28 19:01:50 +0200803//#define MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
Gilles Peskine69d7c8b2019-02-19 14:00:31 +0100804
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100805/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200806 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +0200807 *
808 * Support external private RSA keys (eg from a HSM) in the PK layer.
809 *
810 * Comment this macro to disable support for external private RSA keys.
811 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200812#define MBEDTLS_PK_RSA_ALT_SUPPORT
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +0200813
814/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200815 * \def MBEDTLS_PKCS1_V15
Paul Bakker48377d92013-08-30 12:06:24 +0200816 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200817 * Enable support for PKCS#1 v1.5 encoding.
818 *
Manuel Pégourié-Gonnard98b91d42022-10-19 10:59:30 +0200819 * Requires: MBEDTLS_RSA_C
Paul Bakker48377d92013-08-30 12:06:24 +0200820 *
Paul Bakker48377d92013-08-30 12:06:24 +0200821 * This enables support for PKCS#1 v1.5 operations.
822 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200823#define MBEDTLS_PKCS1_V15
Paul Bakker48377d92013-08-30 12:06:24 +0200824
825/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200826 * \def MBEDTLS_PKCS1_V21
Paul Bakker9dcc3222011-03-08 14:16:06 +0000827 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200828 * Enable support for PKCS#1 v2.1 encoding.
829 *
Manuel Pégourié-Gonnardfb8d90a2023-03-16 10:47:59 +0100830 * Requires: MBEDTLS_RSA_C
Manuel Pégourié-Gonnard077ba842022-07-27 10:42:31 +0200831 *
Manuel Pégourié-Gonnardfb8d90a2023-03-16 10:47:59 +0100832 * \warning If using a hash that is only provided by PSA drivers, you must
833 * call psa_crypto_init() before doing any PKCS#1 v2.1 operation.
Manuel Pégourié-Gonnard18a38562022-11-22 11:49:55 +0100834 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000835 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
836 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200837#define MBEDTLS_PKCS1_V21
Paul Bakker9dcc3222011-03-08 14:16:06 +0000838
Steven Cooreman6801f082021-02-19 17:21:22 +0100839/** \def MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
840 *
841 * Enable support for platform built-in keys. If you enable this feature,
842 * you must implement the function mbedtls_psa_platform_get_builtin_key().
843 * See the documentation of that function for more information.
844 *
845 * Built-in keys are typically derived from a hardware unique key or
846 * stored in a secure element.
847 *
848 * Requires: MBEDTLS_PSA_CRYPTO_C.
849 *
850 * \warning This interface is experimental and may change or be removed
851 * without notice.
852 */
853//#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
854
Ronald Cron3768ac12021-01-26 16:58:00 +0100855/** \def MBEDTLS_PSA_CRYPTO_CLIENT
856 *
857 * Enable support for PSA crypto client.
858 *
859 * \note This option allows to include the code necessary for a PSA
860 * crypto client when the PSA crypto implementation is not included in
861 * the library (MBEDTLS_PSA_CRYPTO_C disabled). The code included is the
862 * code to set and get PSA key attributes.
863 * The development of PSA drivers partially relying on the library to
864 * fulfill the hardware gaps is another possible usage of this option.
865 *
866 * \warning This interface is experimental and may change or be removed
867 * without notice.
868 */
869//#define MBEDTLS_PSA_CRYPTO_CLIENT
870
Gilles Peskinef08b3f82020-11-13 17:36:48 +0100871/** \def MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
872 *
873 * Make the PSA Crypto module use an external random generator provided
874 * by a driver, instead of Mbed TLS's entropy and DRBG modules.
875 *
Gilles Peskineb663a602020-11-18 15:27:37 +0100876 * \note This random generator must deliver random numbers with cryptographic
877 * quality and high performance. It must supply unpredictable numbers
878 * with a uniform distribution. The implementation of this function
879 * is responsible for ensuring that the random generator is seeded
880 * with sufficient entropy. If you have a hardware TRNG which is slow
881 * or delivers non-uniform output, declare it as an entropy source
882 * with mbedtls_entropy_add_source() instead of enabling this option.
883 *
Gilles Peskineb0a748e2020-11-30 12:01:54 +0100884 * If you enable this option, you must configure the type
Gilles Peskineb8af2282020-11-13 18:00:34 +0100885 * ::mbedtls_psa_external_random_context_t in psa/crypto_platform.h
886 * and define a function called mbedtls_psa_external_get_random()
887 * with the following prototype:
Gilles Peskinef08b3f82020-11-13 17:36:48 +0100888 * ```
889 * psa_status_t mbedtls_psa_external_get_random(
890 * mbedtls_psa_external_random_context_t *context,
891 * uint8_t *output, size_t output_size, size_t *output_length);
892 * );
893 * ```
894 * The \c context value is initialized to 0 before the first call.
Andrzej Kurek3bedb5b2022-02-17 14:39:00 -0500895 * The function must fill the \c output buffer with \c output_size bytes
896 * of random data and set \c *output_length to \c output_size.
Gilles Peskinef08b3f82020-11-13 17:36:48 +0100897 *
898 * Requires: MBEDTLS_PSA_CRYPTO_C
899 *
900 * \warning If you enable this option, code that uses the PSA cryptography
901 * interface will not use any of the entropy sources set up for
902 * the entropy module, nor the NV seed that MBEDTLS_ENTROPY_NV_SEED
903 * enables.
904 *
905 * \note This option is experimental and may be removed without notice.
906 */
907//#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
908
Paul Bakker9dcc3222011-03-08 14:16:06 +0000909/**
Andrzej Kurekc6905232019-02-05 05:23:41 -0500910 * \def MBEDTLS_PSA_CRYPTO_SPM
911 *
912 * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure
913 * Partition Manager) integration which separates the code into two parts: a
914 * NSPE (Non-Secure Process Environment) and an SPE (Secure Process
915 * Environment).
916 *
Gilles Peskine7a6836b2023-09-27 15:48:47 +0200917 * If you enable this option, your build environment must include a header
918 * file `"crypto_spe.h"` (either in the `psa` subdirectory of the Mbed TLS
919 * header files, or in another directory on the compiler's include search
920 * path). Alternatively, your platform may customize the header
921 * `psa/crypto_platform.h`, in which case it can skip or replace the
922 * inclusion of `"crypto_spe.h"`.
923 *
Andrzej Kurekc6905232019-02-05 05:23:41 -0500924 * Module: library/psa_crypto.c
925 * Requires: MBEDTLS_PSA_CRYPTO_C
926 *
927 */
928//#define MBEDTLS_PSA_CRYPTO_SPM
929
930/**
Gilles Peskine9e9e1f62024-05-31 18:38:36 +0200931 * \def MBEDTLS_PSA_KEY_STORE_DYNAMIC
932 *
933 * Dynamically resize the PSA key store to accommodate any number of
934 * volatile keys (until the heap memory is exhausted).
935 *
936 * If this option is disabled, the key store has a fixed size
937 * #MBEDTLS_PSA_KEY_SLOT_COUNT for volatile keys and loaded persistent keys
938 * together.
939 *
940 * This option has no effect when #MBEDTLS_PSA_CRYPTO_C is disabled.
941 *
942 * Module: library/psa_crypto.c
943 * Requires: MBEDTLS_PSA_CRYPTO_C
944 */
945#define MBEDTLS_PSA_KEY_STORE_DYNAMIC
946
947/**
Gilles Peskine08b66cd2023-09-20 20:51:47 +0200948 * Uncomment to enable p256-m. This is an alternative implementation of
949 * key generation, ECDH and (randomized) ECDSA on the curve SECP256R1.
950 * Compared to the default implementation:
951 *
952 * - p256-m has a much smaller code size and RAM footprint.
Janos Follath277bba82024-11-19 16:14:00 +0000953 * - p256-m is only available via the PSA API. This includes the pk module.
Gilles Peskine08b66cd2023-09-20 20:51:47 +0200954 * - p256-m does not support deterministic ECDSA, EC-JPAKE, custom protocols
955 * over the core arithmetic, or deterministic derivation of keys.
956 *
957 * We recommend enabling this option if your application uses the PSA API
958 * and the only elliptic curve support it needs is ECDH and ECDSA over
959 * SECP256R1.
960 *
961 * If you enable this option, you do not need to enable any ECC-related
962 * MBEDTLS_xxx option. You do need to separately request support for the
963 * cryptographic mechanisms through the PSA API:
Ronald Cron93ba6252024-09-05 10:37:14 +0200964 * - #MBEDTLS_PSA_CRYPTO_C for PSA-based configuration;
Gilles Peskine08b66cd2023-09-20 20:51:47 +0200965 * - #PSA_WANT_ECC_SECP_R1_256;
966 * - #PSA_WANT_ALG_ECDH and/or #PSA_WANT_ALG_ECDSA as needed;
967 * - #PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY, #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC,
968 * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT,
969 * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT and/or
970 * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE as needed.
Gilles Peskine67cf66b2023-09-20 23:19:46 +0200971 *
Manuel Pégourié-Gonnard140c08e2023-09-28 11:02:37 +0200972 * \note To benefit from the smaller code size of p256-m, make sure that you
973 * do not enable any ECC-related option not supported by p256-m: this
974 * would cause the built-in ECC implementation to be built as well, in
975 * order to provide the required option.
976 * Make sure #PSA_WANT_ALG_DETERMINISTIC_ECDSA, #PSA_WANT_ALG_JPAKE and
Manuel Pégourié-Gonnarddfa42b32023-09-22 12:33:58 +0200977 * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE, and curves other than
978 * SECP256R1 are disabled as they are not supported by this driver.
979 * Also, avoid defining #MBEDTLS_PK_PARSE_EC_COMPRESSED or
980 * #MBEDTLS_PK_PARSE_EC_EXTENDED as those currently require a subset of
Manuel Pégourié-Gonnard140c08e2023-09-28 11:02:37 +0200981 * the built-in ECC implementation, see docs/driver-only-builds.md.
Gilles Peskine08b66cd2023-09-20 20:51:47 +0200982 */
983//#define MBEDTLS_PSA_P256M_DRIVER_ENABLED
984
985/**
Jaeden Amero57f4d9e2019-03-15 16:14:19 +0000986 * \def MBEDTLS_PSA_INJECT_ENTROPY
Andrzej Kurekc6905232019-02-05 05:23:41 -0500987 *
Jaeden Amero57f4d9e2019-03-15 16:14:19 +0000988 * Enable support for entropy injection at first boot. This feature is
989 * required on systems that do not have a built-in entropy source (TRNG).
990 * This feature is currently not supported on systems that have a built-in
991 * entropy source.
Andrzej Kurekc6905232019-02-05 05:23:41 -0500992 *
Jaeden Amero57f4d9e2019-03-15 16:14:19 +0000993 * Requires: MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_ENTROPY_NV_SEED
Andrzej Kurekc6905232019-02-05 05:23:41 -0500994 *
995 */
Jaeden Amero57f4d9e2019-03-15 16:14:19 +0000996//#define MBEDTLS_PSA_INJECT_ENTROPY
Andrzej Kurekc6905232019-02-05 05:23:41 -0500997
998/**
David Horstmann4a48bec2024-03-13 15:42:31 +0000999 * \def MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
David Horstmann513101b2023-11-29 17:24:08 +00001000 *
David Horstmann4a48bec2024-03-13 15:42:31 +00001001 * Assume all buffers passed to PSA functions are owned exclusively by the
1002 * PSA function and are not stored in shared memory.
David Horstmann513101b2023-11-29 17:24:08 +00001003 *
David Horstmann4a48bec2024-03-13 15:42:31 +00001004 * This option may be enabled if all buffers passed to any PSA function reside
1005 * in memory that is accessible only to the PSA function during its execution.
1006 *
1007 * This option MUST be disabled whenever buffer arguments are in memory shared
1008 * with an untrusted party, for example where arguments to PSA calls are passed
David Horstmann513101b2023-11-29 17:24:08 +00001009 * across a trust boundary.
1010 *
David Horstmann4a48bec2024-03-13 15:42:31 +00001011 * \note Enabling this option reduces memory usage and code size.
David Horstmann0d405d82023-12-14 16:14:41 +00001012 *
David Horstmann4a48bec2024-03-13 15:42:31 +00001013 * \note Enabling this option causes overlap of input and output buffers
David Horstmannc09f36d2023-12-20 10:57:43 +00001014 * not to be supported by PSA functions.
David Horstmann513101b2023-11-29 17:24:08 +00001015 */
David Horstmann4a48bec2024-03-13 15:42:31 +00001016//#define MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
David Horstmann513101b2023-11-29 17:24:08 +00001017
1018/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001019 * \def MBEDTLS_RSA_NO_CRT
Paul Bakker0216cc12011-03-26 13:40:23 +00001020 *
Hanno Becker88ec2382017-05-03 13:51:16 +01001021 * Do not use the Chinese Remainder Theorem
1022 * for the RSA private operation.
Paul Bakker0216cc12011-03-26 13:40:23 +00001023 *
1024 * Uncomment this macro to disable the use of CRT in RSA.
1025 *
Paul Bakker0216cc12011-03-26 13:40:23 +00001026 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001027//#define MBEDTLS_RSA_NO_CRT
Paul Bakker15566e42011-04-24 21:19:15 +00001028
1029/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001030 * \def MBEDTLS_SELF_TEST
Paul Bakker15566e42011-04-24 21:19:15 +00001031 *
1032 * Enable the checkup functions (*_self_test).
1033 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001034#define MBEDTLS_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +00001035
1036/**
Manuel Pégourié-Gonnardeb0d8702015-05-28 12:54:04 +02001037 * \def MBEDTLS_SHA256_SMALLER
1038 *
1039 * Enable an implementation of SHA-256 that has lower ROM footprint but also
1040 * lower performance.
1041 *
Adam Wolf039080f2019-09-10 09:53:08 -05001042 * The default implementation is meant to be a reasonable compromise between
Manuel Pégourié-Gonnardeb0d8702015-05-28 12:54:04 +02001043 * performance and size. This version optimizes more aggressively for size at
1044 * the expense of performance. Eg on Cortex-M4 it reduces the size of
1045 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
1046 * 30%.
1047 *
1048 * Uncomment to enable the smaller implementation of SHA256.
1049 */
1050//#define MBEDTLS_SHA256_SMALLER
1051
1052/**
Manuel Pégourié-Gonnard2306d152019-07-17 12:36:53 +02001053 * \def MBEDTLS_SHA512_SMALLER
1054 *
1055 * Enable an implementation of SHA-512 that has lower ROM footprint but also
1056 * lower performance.
1057 *
1058 * Uncomment to enable the smaller implementation of SHA512.
1059 */
1060//#define MBEDTLS_SHA512_SMALLER
1061
1062/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001063 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +01001064 *
1065 * Enable sending of alert messages in case of encountered errors as per RFC.
Gilles Peskinee820c0a2023-08-03 17:45:20 +02001066 * If you choose not to send the alert messages, Mbed TLS can still communicate
Paul Bakker40865c82013-01-31 17:13:13 +01001067 * with other servers, only debugging of failures is harder.
1068 *
1069 * The advantage of not sending alert messages, is that no information is given
1070 * about reasons for failures thus preventing adversaries of gaining intel.
1071 *
1072 * Enable sending of all alert messages
1073 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001074#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +01001075
1076/**
Gilles Peskined3d02902020-03-04 21:35:27 +01001077 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID
1078 *
Hannes Tschofenige2c46e02022-11-23 10:44:11 +01001079 * Enable support for the DTLS Connection ID (CID) extension,
Gilles Peskined3d02902020-03-04 21:35:27 +01001080 * which allows to identify DTLS connections across changes
Hannes Tschofenige2c46e02022-11-23 10:44:11 +01001081 * in the underlying transport. The CID functionality is described
1082 * in RFC 9146.
Gilles Peskined3d02902020-03-04 21:35:27 +01001083 *
1084 * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`,
Paul Elliott0113cf12022-03-11 20:26:47 +00001085 * mbedtls_ssl_get_own_cid()`, `mbedtls_ssl_get_peer_cid()` and
1086 * `mbedtls_ssl_conf_cid()`. See the corresponding documentation for
1087 * more information.
Gilles Peskined3d02902020-03-04 21:35:27 +01001088 *
Gilles Peskined3d02902020-03-04 21:35:27 +01001089 * The maximum lengths of outgoing and incoming CIDs can be configured
1090 * through the options
1091 * - MBEDTLS_SSL_CID_OUT_LEN_MAX
1092 * - MBEDTLS_SSL_CID_IN_LEN_MAX.
1093 *
1094 * Requires: MBEDTLS_SSL_PROTO_DTLS
1095 *
1096 * Uncomment to enable the Connection ID extension.
1097 */
Hannes Tschofenigfd6cca42021-10-12 09:22:33 +02001098#define MBEDTLS_SSL_DTLS_CONNECTION_ID
1099
1100
1101/**
1102 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
1103 *
1104 * Defines whether RFC 9146 (default) or the legacy version
1105 * (version draft-ietf-tls-dtls-connection-id-05,
1106 * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05)
1107 * is used.
1108 *
1109 * Set the value to 0 for the standard version, and
1110 * 1 for the legacy draft version.
1111 *
Hannes Tschofenige2c46e02022-11-23 10:44:11 +01001112 * \deprecated Support for the legacy version of the DTLS
1113 * Connection ID feature is deprecated. Please
1114 * switch to the standardized version defined
1115 * in RFC 9146 enabled by utilizing
1116 * MBEDTLS_SSL_DTLS_CONNECTION_ID without use
1117 * of MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT.
1118 *
Hannes Tschofenigfd6cca42021-10-12 09:22:33 +02001119 * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID
1120 */
1121#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 0
Gilles Peskined3d02902020-03-04 21:35:27 +01001122
1123/**
Gilles Peskineb74a1c72018-04-24 13:09:22 +02001124 * \def MBEDTLS_SSL_ASYNC_PRIVATE
1125 *
1126 * Enable asynchronous external private key operations in SSL. This allows
1127 * you to configure an SSL connection to call an external cryptographic
1128 * module to perform private key operations instead of performing the
1129 * operation inside the library.
1130 *
Valerio Setti8841d6b2023-01-05 08:40:24 +01001131 * Requires: MBEDTLS_X509_CRT_PARSE_C
Gilles Peskineb74a1c72018-04-24 13:09:22 +02001132 */
Jaeden Amerod9c71da2018-06-15 20:31:26 +01001133//#define MBEDTLS_SSL_ASYNC_PRIVATE
Gilles Peskineb74a1c72018-04-24 13:09:22 +02001134
1135/**
Gilles Peskined3d02902020-03-04 21:35:27 +01001136 * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION
1137 *
1138 * Enable serialization of the TLS context structures, through use of the
1139 * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
1140 *
1141 * This pair of functions allows one side of a connection to serialize the
1142 * context associated with the connection, then free or re-use that context
1143 * while the serialized state is persisted elsewhere, and finally deserialize
1144 * that state to a live context for resuming read/write operations on the
1145 * connection. From a protocol perspective, the state of the connection is
1146 * unaffected, in particular this is entirely transparent to the peer.
1147 *
1148 * Note: this is distinct from TLS session resumption, which is part of the
1149 * protocol and fully visible by the peer. TLS session resumption enables
1150 * establishing new connections associated to a saved session with shorter,
1151 * lighter handshakes, while context serialization is a local optimization in
1152 * handling a single, potentially long-lived connection.
1153 *
1154 * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are
1155 * saved after the handshake to allow for more efficient serialization, so if
1156 * you don't need this feature you'll save RAM by disabling it.
1157 *
Przemek Stekiel460192e2022-10-03 08:55:29 +02001158 * Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C
1159 *
Gilles Peskined3d02902020-03-04 21:35:27 +01001160 * Comment to disable the context serialization APIs.
1161 */
1162#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
1163
1164/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001165 * \def MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +01001166 *
1167 * Enable the debug messages in SSL module for all issues.
1168 * Debug messages have been disabled in some places to prevent timing
1169 * attacks due to (unbalanced) debugging function calls.
1170 *
1171 * If you need all error reporting you should enable this during debugging,
1172 * but remove this for production servers that should log as well.
1173 *
1174 * Uncomment this macro to report all debug messages on errors introducing
1175 * a timing side-channel.
1176 *
Paul Bakkerd66f0702013-01-31 16:57:45 +01001177 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001178//#define MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +01001179
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001180/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +01001181 *
1182 * Enable support for Encrypt-then-MAC, RFC 7366.
1183 *
1184 * This allows peers that both support it to use a more robust protection for
1185 * ciphersuites using CBC, providing deep resistance against timing attacks
1186 * on the padding or underlying cipher.
1187 *
1188 * This only affects CBC ciphersuites, and is useless if none is defined.
1189 *
TRodziewicz0f82ec62021-05-12 17:49:18 +02001190 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +01001191 *
1192 * Comment this macro to disable support for Encrypt-then-MAC
1193 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001194#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +01001195
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001196/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +02001197 *
Manuel Pégourié-Gonnardbca8aa02020-03-24 12:11:49 +01001198 * Enable support for RFC 7627: Session Hash and Extended Master Secret
1199 * Extension.
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +02001200 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -08001201 * This was introduced as "the proper fix" to the Triple Handshake family of
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +02001202 * attacks, but it is recommended to always use it (even if you disable
1203 * renegotiation), since it actually fixes a more fundamental issue in the
1204 * original SSL/TLS design, and has implications beyond Triple Handshake.
1205 *
TRodziewicz0f82ec62021-05-12 17:49:18 +02001206 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +01001207 *
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +02001208 * Comment this macro to disable support for Extended Master Secret.
1209 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001210#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +02001211
Paul Bakkerd66f0702013-01-31 16:57:45 +01001212/**
Hanno Beckerbb278f52019-02-05 17:04:00 +00001213 * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
1214 *
Hanno Beckerfd7f2982019-02-25 10:13:33 +00001215 * This option controls the availability of the API mbedtls_ssl_get_peer_cert()
Hanno Beckerbb278f52019-02-05 17:04:00 +00001216 * giving access to the peer's certificate after completion of the handshake.
1217 *
1218 * Unless you need mbedtls_ssl_peer_cert() in your application, it is
1219 * recommended to disable this option for reduced RAM usage.
1220 *
1221 * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still
1222 * defined, but always returns \c NULL.
1223 *
1224 * \note This option has no influence on the protection against the
1225 * triple handshake attack. Even if it is disabled, Mbed TLS will
1226 * still ensure that certificates do not change during renegotiation,
Shaun Case8b0ecbc2021-12-20 21:14:10 -08001227 * for example by keeping a hash of the peer's certificate.
Hanno Beckerbb278f52019-02-05 17:04:00 +00001228 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +01001229 * \note This option is required if MBEDTLS_SSL_PROTO_TLS1_3 is set.
Hanno Beckerbb278f52019-02-05 17:04:00 +00001230 *
1231 * Comment this macro to disable storing the peer's certificate
1232 * after the handshake.
1233 */
1234#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
1235
1236/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001237 * \def MBEDTLS_SSL_RENEGOTIATION
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +01001238 *
Hanno Becker0eb8fb82018-10-26 09:53:16 +01001239 * Enable support for TLS renegotiation.
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +01001240 *
1241 * The two main uses of renegotiation are (1) refresh keys on long-lived
1242 * connections and (2) client authentication after the initial handshake.
1243 * If you don't need renegotiation, it's probably better to disable it, since
1244 * it has been associated with security issues in the past and is easy to
1245 * misuse/misunderstand.
Manuel Pégourié-Gonnard03717042014-11-04 19:52:10 +01001246 *
jnmeurisse83f0a652023-09-16 18:12:18 +02001247 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
1248 *
Manuel Pégourié-Gonnard55f968b2015-03-09 16:23:15 +00001249 * Comment this to disable support for renegotiation.
Hanno Becker6851b102017-10-12 14:57:48 +01001250 *
1251 * \note Even if this option is disabled, both client and server are aware
1252 * of the Renegotiation Indication Extension (RFC 5746) used to
1253 * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
1254 * (See \c mbedtls_ssl_conf_legacy_renegotiation for the
1255 * configuration of this extension).
1256 *
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +01001257 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001258#define MBEDTLS_SSL_RENEGOTIATION
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +01001259
1260/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001261 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +02001262 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001263 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +02001264 *
1265 * Comment this macro to disable support for the max_fragment_length extension
1266 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001267#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +02001268
1269/**
Jan Bruckner151f6422023-02-10 12:45:19 +01001270 * \def MBEDTLS_SSL_RECORD_SIZE_LIMIT
1271 *
Jan Brucknera0589e72023-03-15 11:04:45 +01001272 * Enable support for RFC 8449 record_size_limit extension in SSL (TLS 1.3 only).
Jan Bruckner151f6422023-02-10 12:45:19 +01001273 *
Jan Bruckner151f6422023-02-10 12:45:19 +01001274 * Requires: MBEDTLS_SSL_PROTO_TLS1_3
1275 *
1276 * Uncomment this macro to enable support for the record_size_limit extension
1277 */
1278//#define MBEDTLS_SSL_RECORD_SIZE_LIMIT
1279
1280/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001281 * \def MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001282 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +01001283 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001284 *
Janos Follath277bba82024-11-19 16:14:00 +00001285 * Requires: PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384
Andrzej Kureke02da812022-08-17 17:04:49 -04001286 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +01001287 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001288 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001289#define MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001290
1291/**
Ronald Cron6f135e12021-12-08 16:57:54 +01001292 * \def MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +01001293 *
Ronald Cron6f135e12021-12-08 16:57:54 +01001294 * Enable support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +01001295 *
Gilles Peskineda69eaa2023-09-05 20:54:17 +02001296 * \note See docs/architecture/tls13-support.md for a description of the TLS
Ronald Cron6f135e12021-12-08 16:57:54 +01001297 * 1.3 support that this option enables.
Hanno Becker9fc15ea2020-05-04 12:00:47 +01001298 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +01001299 * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
Manuel Pégourié-Gonnard3e830982022-05-11 13:27:44 +02001300 * Requires: MBEDTLS_PSA_CRYPTO_C
Ronald Cron6f135e12021-12-08 16:57:54 +01001301 *
Hanno Becker9fc15ea2020-05-04 12:00:47 +01001302 * Uncomment this macro to enable the support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +01001303 */
Ronald Cron27eb68d2024-03-15 16:13:37 +01001304#define MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +01001305
1306/**
Ronald Cronab65c522021-11-24 10:47:20 +01001307 * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
1308 *
1309 * Enable TLS 1.3 middlebox compatibility mode.
1310 *
1311 * As specified in Section D.4 of RFC 8446, TLS 1.3 offers a compatibility
1312 * mode to make a TLS 1.3 connection more likely to pass through middle boxes
1313 * expecting TLS 1.2 traffic.
1314 *
1315 * Turning on the compatibility mode comes at the cost of a few added bytes
1316 * on the wire, but it doesn't affect compatibility with TLS 1.3 implementations
1317 * that don't use it. Therefore, unless transmission bandwidth is critical and
1318 * you know that middlebox compatibility issues won't occur, it is therefore
1319 * recommended to set this option.
1320 *
1321 * Comment to disable compatibility mode for TLS 1.3. If
Ronald Cron6f135e12021-12-08 16:57:54 +01001322 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
1323 * effect on the build.
Ronald Cronab65c522021-11-24 10:47:20 +01001324 *
1325 */
Ronald Cron27eb68d2024-03-15 16:13:37 +01001326#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
Ronald Cronab65c522021-11-24 10:47:20 +01001327
1328/**
Ronald Crond8d2ea52022-10-04 15:48:06 +02001329 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
1330 *
1331 * Enable TLS 1.3 PSK key exchange mode.
1332 *
1333 * Comment to disable support for the PSK key exchange mode in TLS 1.3. If
1334 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
1335 * effect on the build.
1336 *
1337 */
1338#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
1339
1340/**
1341 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
1342 *
1343 * Enable TLS 1.3 ephemeral key exchange mode.
1344 *
Przemek Stekielce05f542023-06-15 16:44:08 +02001345 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +02001346 * MBEDTLS_X509_CRT_PARSE_C
1347 * and at least one of:
Janos Follath277bba82024-11-19 16:14:00 +00001348 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +02001349 * MBEDTLS_PKCS1_V21
Ronald Crond8d2ea52022-10-04 15:48:06 +02001350 *
1351 * Comment to disable support for the ephemeral key exchange mode in TLS 1.3.
1352 * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
1353 * effect on the build.
1354 *
1355 */
1356#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
1357
1358/**
1359 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
1360 *
1361 * Enable TLS 1.3 PSK ephemeral key exchange mode.
1362 *
Przemek Stekielce05f542023-06-15 16:44:08 +02001363 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Ronald Crond8d2ea52022-10-04 15:48:06 +02001364 *
1365 * Comment to disable support for the PSK ephemeral key exchange mode in
1366 * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not
1367 * have any effect on the build.
1368 *
1369 */
1370#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
1371
1372/**
Gilles Peskine449bd832023-01-11 14:50:10 +01001373 * \def MBEDTLS_SSL_EARLY_DATA
1374 *
1375 * Enable support for RFC 8446 TLS 1.3 early data.
1376 *
1377 * Requires: MBEDTLS_SSL_SESSION_TICKETS and either
1378 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or
1379 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
1380 *
1381 * Comment this to disable support for early data. If MBEDTLS_SSL_PROTO_TLS1_3
1382 * is not enabled, this option does not have any effect on the build.
1383 *
Tom Cosgrovea63775b2023-09-14 13:31:19 +01001384 * \note The maximum amount of early data can be set with
1385 * MBEDTLS_SSL_MAX_EARLY_DATA_SIZE.
1386 *
Gilles Peskine449bd832023-01-11 14:50:10 +01001387 */
Ronald Cronc2e110f2022-11-22 09:01:46 +01001388//#define MBEDTLS_SSL_EARLY_DATA
Xiaokang Qian54413b12022-10-20 05:57:03 +00001389
1390/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001391 * \def MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +01001392 *
1393 * Enable support for DTLS (all available versions).
1394 *
TRodziewicz0f82ec62021-05-12 17:49:18 +02001395 * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +01001396 *
TRodziewicz0f82ec62021-05-12 17:49:18 +02001397 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +01001398 *
1399 * Comment this macro to disable support for DTLS
1400 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001401#define MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +01001402
1403/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001404 * \def MBEDTLS_SSL_ALPN
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +02001405 *
Manuel Pégourié-Gonnard6b298e62014-11-20 18:28:50 +01001406 * Enable support for RFC 7301 Application Layer Protocol Negotiation.
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +02001407 *
Paul Bakker27e36d32014-04-08 12:33:37 +02001408 * Comment this macro to disable support for ALPN.
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +02001409 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001410#define MBEDTLS_SSL_ALPN
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +02001411
1412/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001413 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +02001414 *
1415 * Enable support for the anti-replay mechanism in DTLS.
1416 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001417 * Requires: MBEDTLS_SSL_TLS_C
1418 * MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +02001419 *
Manuel Pégourié-Gonnarda6fcffe2014-10-13 18:15:52 +02001420 * \warning Disabling this is often a security risk!
Manuel Pégourié-Gonnard6729e792015-05-11 09:50:24 +02001421 * See mbedtls_ssl_conf_dtls_anti_replay() for details.
Manuel Pégourié-Gonnarda6fcffe2014-10-13 18:15:52 +02001422 *
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +02001423 * Comment this to disable anti-replay in DTLS.
1424 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001425#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +02001426
1427/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001428 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +02001429 *
1430 * Enable support for HelloVerifyRequest on DTLS servers.
1431 *
1432 * This feature is highly recommended to prevent DTLS servers being used as
1433 * amplifiers in DoS attacks against other hosts. It should always be enabled
1434 * unless you know for sure amplification cannot be a problem in the
1435 * environment in which your server operates.
1436 *
Andrzej Kurek5c65c572022-04-13 14:28:52 -04001437 * \warning Disabling this can be a security risk! (see above)
Manuel Pégourié-Gonnarda6fcffe2014-10-13 18:15:52 +02001438 *
Manuel Pégourié-Gonnarde057d3b2015-05-20 10:59:43 +02001439 * Requires: MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +02001440 *
1441 * Comment this to disable support for HelloVerifyRequest.
1442 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001443#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +02001444
1445/**
Johan Pascalb62bb512015-12-03 21:56:45 +01001446 * \def MBEDTLS_SSL_DTLS_SRTP
1447 *
Tobias Nießen1e8ca122021-05-10 19:53:15 +02001448 * Enable support for negotiation of DTLS-SRTP (RFC 5764)
Johan Pascal842d6712020-09-23 13:34:40 +02001449 * through the use_srtp extension.
1450 *
1451 * \note This feature provides the minimum functionality required
1452 * to negotiate the use of DTLS-SRTP and to allow the derivation of
1453 * the associated SRTP packet protection key material.
1454 * In particular, the SRTP packet protection itself, as well as the
1455 * demultiplexing of RTP and DTLS packets at the datagram layer
1456 * (see Section 5 of RFC 5764), are not handled by this feature.
1457 * Instead, after successful completion of a handshake negotiating
1458 * the use of DTLS-SRTP, the extended key exporter API
Hanno Becker2d6e6f82021-05-24 10:58:31 +01001459 * mbedtls_ssl_conf_export_keys_cb() should be used to implement
Johan Pascal842d6712020-09-23 13:34:40 +02001460 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
1461 * (this is implemented in the SSL example programs).
1462 * The resulting key should then be passed to an SRTP stack.
1463 *
1464 * Setting this option enables the runtime API
1465 * mbedtls_ssl_conf_dtls_srtp_protection_profiles()
1466 * through which the supported DTLS-SRTP protection
1467 * profiles can be configured. You must call this API at
1468 * runtime if you wish to negotiate the use of DTLS-SRTP.
Johan Pascalb62bb512015-12-03 21:56:45 +01001469 *
1470 * Requires: MBEDTLS_SSL_PROTO_DTLS
1471 *
Ron Eldor9cfb5eb2018-12-10 15:30:14 +02001472 * Uncomment this to enable support for use_srtp extension.
Johan Pascalb62bb512015-12-03 21:56:45 +01001473 */
Ron Eldor9cfb5eb2018-12-10 15:30:14 +02001474//#define MBEDTLS_SSL_DTLS_SRTP
Johan Pascalb62bb512015-12-03 21:56:45 +01001475
1476/**
Manuel Pégourié-Gonnard26d227d2015-09-04 10:53:25 +02001477 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1478 *
1479 * Enable server-side support for clients that reconnect from the same port.
1480 *
1481 * Some clients unexpectedly close the connection and try to reconnect using the
1482 * same source port. This needs special support from the server to handle the
Simon Butcher4f6882a2015-09-11 17:12:46 +01001483 * new connection securely, as described in section 4.2.8 of RFC 6347. This
Manuel Pégourié-Gonnard26d227d2015-09-04 10:53:25 +02001484 * flag enables that support.
1485 *
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +02001486 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +02001487 *
Manuel Pégourié-Gonnard26d227d2015-09-04 10:53:25 +02001488 * Comment this to disable support for clients reusing the source port.
1489 */
1490#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1491
1492/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001493 * \def MBEDTLS_SSL_SESSION_TICKETS
Paul Bakkera503a632013-08-14 13:48:06 +02001494 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001495 * Enable support for RFC 5077 session tickets in SSL.
Antonin Décimo36e89b52019-01-23 15:24:37 +01001496 * Client-side, provides full support for session tickets (maintenance of a
Manuel Pégourié-Gonnard0c0f11f2015-05-20 09:55:50 +02001497 * session store remains the responsibility of the application, though).
1498 * Server-side, you also need to provide callbacks for writing and parsing
1499 * tickets, including authenticated encryption and key management. Example
1500 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
Paul Bakkera503a632013-08-14 13:48:06 +02001501 *
1502 * Comment this macro to disable support for SSL session tickets
1503 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001504#define MBEDTLS_SSL_SESSION_TICKETS
Paul Bakkera503a632013-08-14 13:48:06 +02001505
1506/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001507 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
Paul Bakker0be444a2013-08-27 21:55:01 +02001508 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001509 * Enable support for RFC 6066 server name indication (SNI) in SSL.
Paul Bakker0be444a2013-08-27 21:55:01 +02001510 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001511 * Requires: MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnardbbbb3cf2015-01-28 16:44:37 +00001512 *
Paul Bakker0be444a2013-08-27 21:55:01 +02001513 * Comment this macro to disable support for server name indication in SSL
1514 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001515#define MBEDTLS_SSL_SERVER_NAME_INDICATION
Paul Bakker0be444a2013-08-27 21:55:01 +02001516
1517/**
Gilles Peskinef03bd812020-03-23 18:13:58 +01001518 * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
1519 *
Andrzej Kurek2a54a6f2021-01-07 08:13:49 -05001520 * When this option is enabled, the SSL buffer will be resized automatically
1521 * based on the negotiated maximum fragment length in each direction.
Andrzej Kurek557289b2020-10-21 15:12:39 +02001522 *
1523 * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Gilles Peskinef03bd812020-03-23 18:13:58 +01001524 */
1525//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
1526
1527/**
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +02001528 * \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
1529 *
1530 * Enable testing of the constant-flow nature of some sensitive functions with
1531 * clang's MemorySanitizer. This causes some existing tests to also test
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +02001532 * this non-functional property of the code under test.
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +02001533 *
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +02001534 * This setting requires compiling with clang -fsanitize=memory. The test
1535 * suites can then be run normally.
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +02001536 *
Manuel Pégourié-Gonnard8ff863b2020-07-31 12:59:34 +02001537 * \warning This macro is only used for extended testing; it is not considered
1538 * part of the library's API, so it may change or disappear at any time.
1539 *
Manuel Pégourié-Gonnard390fb4f2020-07-24 11:08:40 +02001540 * Uncomment to enable testing of the constant-flow nature of selected code.
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +02001541 */
1542//#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
1543
1544/**
Manuel Pégourié-Gonnard73afa372020-08-19 10:27:38 +02001545 * \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
1546 *
1547 * Enable testing of the constant-flow nature of some sensitive functions with
1548 * valgrind's memcheck tool. This causes some existing tests to also test
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +02001549 * this non-functional property of the code under test.
Manuel Pégourié-Gonnard73afa372020-08-19 10:27:38 +02001550 *
1551 * This setting requires valgrind headers for building, and is only useful for
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +02001552 * testing if the tests suites are run with valgrind's memcheck. This can be
1553 * done for an individual test suite with 'valgrind ./test_suite_xxx', or when
1554 * using CMake, this can be done for all test suites with 'make memcheck'.
Manuel Pégourié-Gonnard73afa372020-08-19 10:27:38 +02001555 *
1556 * \warning This macro is only used for extended testing; it is not considered
1557 * part of the library's API, so it may change or disappear at any time.
1558 *
1559 * Uncomment to enable testing of the constant-flow nature of selected code.
1560 */
1561//#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
1562
1563/**
Gilles Peskinefea6eaf2019-09-11 13:27:48 +02001564 * \def MBEDTLS_TEST_HOOKS
1565 *
1566 * Enable features for invasive testing such as introspection functions and
1567 * hooks for fault injection. This enables additional unit tests.
1568 *
1569 * Merely enabling this feature should not change the behavior of the product.
1570 * It only adds new code, and new branching points where the default behavior
1571 * is the same as when this feature is disabled.
1572 * However, this feature increases the attack surface: there is an added
1573 * risk of vulnerabilities, and more gadgets that can make exploits easier.
1574 * Therefore this feature must never be enabled in production.
1575 *
1576 * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more
1577 * information.
1578 *
1579 * Uncomment to enable invasive tests.
1580 */
1581//#define MBEDTLS_TEST_HOOKS
1582
1583/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001584 * \def MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +02001585 *
1586 * Allow run-time checking of compile-time enabled features. Thus allowing users
1587 * to check at run-time if the library is for instance compiled with threading
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001588 * support via mbedtls_version_check_feature().
Paul Bakker0f90d7d2014-04-30 11:49:44 +02001589 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001590 * Requires: MBEDTLS_VERSION_C
Paul Bakker0f90d7d2014-04-30 11:49:44 +02001591 *
1592 * Comment this to disable run-time checking and save ROM space
1593 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001594#define MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +02001595
1596/**
Hanno Becker288dedc2019-03-27 11:00:53 +00001597 * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1598 *
Jarno Lamsaf49fedc2019-04-01 14:58:30 +03001599 * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()`
Hanno Becker288dedc2019-03-27 11:00:53 +00001600 * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure
1601 * the set of trusted certificates through a callback instead of a linked
1602 * list.
1603 *
1604 * This is useful for example in environments where a large number of trusted
1605 * certificates is present and storing them in a linked list isn't efficient
1606 * enough, or when the set of trusted certificates changes frequently.
1607 *
Jarno Lamsaf49fedc2019-04-01 14:58:30 +03001608 * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and
Hanno Becker288dedc2019-03-27 11:00:53 +00001609 * `mbedtls_ssl_conf_ca_cb()` for more information.
1610 *
Valerio Setti8e45cdd2023-01-05 09:32:29 +01001611 * Requires: MBEDTLS_X509_CRT_PARSE_C
1612 *
Hanno Becker288dedc2019-03-27 11:00:53 +00001613 * Uncomment to enable trusted certificate callbacks.
1614 */
1615//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1616
1617/**
Hanno Becker612a2f12020-10-09 09:19:39 +01001618 * \def MBEDTLS_X509_REMOVE_INFO
Peter Kolbus9a969b62018-12-11 13:55:56 -06001619 *
Chris Jones2c745862020-12-16 11:41:06 +00001620 * Disable mbedtls_x509_*_info() and related APIs.
Peter Kolbus9a969b62018-12-11 13:55:56 -06001621 *
Chris Jones2c745862020-12-16 11:41:06 +00001622 * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt()
Peter Kolbus9a969b62018-12-11 13:55:56 -06001623 * and other functions/constants only used by these functions, thus reducing
1624 * the code footprint by several KB.
1625 */
Chris Jones2c745862020-12-16 11:41:06 +00001626//#define MBEDTLS_X509_REMOVE_INFO
Peter Kolbus9a969b62018-12-11 13:55:56 -06001627
1628/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001629 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
Manuel Pégourié-Gonnardd1539b12014-06-06 16:42:37 +02001630 *
1631 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
1632 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
1633 *
Tomi Fontanillesa70b3c22023-07-16 12:06:13 +03001634 * Requires: MBEDTLS_PKCS1_V21
1635 *
Manuel Pégourié-Gonnardd1539b12014-06-06 16:42:37 +02001636 * Comment this macro to disallow using RSASSA-PSS in certificates.
1637 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001638#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
Gilles Peskinee820c0a2023-08-03 17:45:20 +02001639/** \} name SECTION: Mbed TLS feature support */
Paul Bakker0a62cd12011-01-21 11:00:08 +00001640
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001641/**
Gilles Peskinee820c0a2023-08-03 17:45:20 +02001642 * \name SECTION: Mbed TLS modules
Paul Bakker0a62cd12011-01-21 11:00:08 +00001643 *
Gilles Peskinee820c0a2023-08-03 17:45:20 +02001644 * This section enables or disables entire modules in Mbed TLS
Paul Bakker0a62cd12011-01-21 11:00:08 +00001645 * \{
1646 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001647
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001648/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001649 * \def MBEDTLS_AESNI_C
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01001650 *
Gilles Peskine0bfccfa2023-03-16 17:49:44 +01001651 * Enable AES-NI support on x86-64 or x86-32.
1652 *
1653 * \note AESNI is only supported with certain compilers and target options:
Bence Szépkútie05b5422024-03-15 12:18:04 +01001654 * - Visual Studio: supported
Gilles Peskine0bfccfa2023-03-16 17:49:44 +01001655 * - GCC, x86-64, target not explicitly supporting AESNI:
1656 * requires MBEDTLS_HAVE_ASM.
1657 * - GCC, x86-32, target not explicitly supporting AESNI:
1658 * not supported.
1659 * - GCC, x86-64 or x86-32, target supporting AESNI: supported.
1660 * For this assembly-less implementation, you must currently compile
1661 * `library/aesni.c` and `library/aes.c` with machine options to enable
1662 * SSE2 and AESNI instructions: `gcc -msse2 -maes -mpclmul` or
1663 * `clang -maes -mpclmul`.
1664 * - Non-x86 targets: this option is silently ignored.
1665 * - Other compilers: this option is silently ignored.
1666 *
1667 * \note
1668 * Above, "GCC" includes compatible compilers such as Clang.
1669 * The limitations on target support are likely to be relaxed in the future.
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01001670 *
1671 * Module: library/aesni.c
1672 * Caller: library/aes.c
1673 *
Gilles Peskine0bfccfa2023-03-16 17:49:44 +01001674 * Requires: MBEDTLS_HAVE_ASM (on some platforms, see note)
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01001675 *
Gilles Peskine0bfccfa2023-03-16 17:49:44 +01001676 * This modules adds support for the AES-NI instructions on x86.
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01001677 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001678#define MBEDTLS_AESNI_C
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01001679
1680/**
Jerry Yu2fddfd72023-01-10 16:32:03 +08001681 * \def MBEDTLS_AESCE_C
1682 *
Dave Rodgman18838f62023-10-08 12:28:51 +01001683 * Enable AES cryptographic extension support on Armv8.
Jerry Yu2fddfd72023-01-10 16:32:03 +08001684 *
1685 * Module: library/aesce.c
1686 * Caller: library/aes.c
1687 *
Jerry Yuf015a932023-04-25 10:38:03 +08001688 * Requires: MBEDTLS_AES_C
Jerry Yu2fddfd72023-01-10 16:32:03 +08001689 *
Dave Rodgmanf918d422023-03-17 17:52:23 +00001690 * \warning Runtime detection only works on Linux. For non-Linux operating
1691 * system, Armv8-A Cryptographic Extensions must be supported by
1692 * the CPU when this option is enabled.
Jerry Yu2fddfd72023-01-10 16:32:03 +08001693 *
Dave Rodgman48b965d2023-10-09 12:19:44 +01001694 * \note Minimum compiler versions for this feature when targeting aarch64
1695 * are Clang 4.0; armclang 6.6; GCC 6.0; or MSVC 2019 version 16.11.2.
1696 * Minimum compiler versions for this feature when targeting 32-bit
1697 * Arm or Thumb are Clang 11.0; armclang 6.20; or GCC 6.0.
Jerry Yu8bfa24b2023-05-05 14:35:00 +08001698 *
1699 * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for
1700 * armclang <= 6.9
Jerry Yu2fddfd72023-01-10 16:32:03 +08001701 *
Dave Rodgman4b8e8dc2023-10-08 21:41:40 +01001702 * This module adds support for the AES Armv8-A Cryptographic Extensions on Armv8 systems.
Jerry Yu2fddfd72023-01-10 16:32:03 +08001703 */
1704#define MBEDTLS_AESCE_C
1705
1706/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001707 * \def MBEDTLS_AES_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001708 *
1709 * Enable the AES block cipher.
1710 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001711 * Module: library/aes.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +01001712 * Caller: library/cipher.c
Paul Bakker96743fc2011-02-12 14:30:57 +00001713 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +00001714 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001715 *
Paul Bakker645ce3a2012-10-31 12:32:41 +00001716 * This module enables the following ciphersuites (if other requisites are
1717 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001718 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
1719 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
1720 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
1721 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
1722 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
1723 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
1724 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
1725 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
1726 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
1727 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
1728 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
1729 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
1730 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
1731 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
1732 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
1733 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
1734 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
1735 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
1736 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
1737 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
1738 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
1739 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
1740 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
1741 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
1742 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
1743 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
1744 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
1745 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
1746 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
1747 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
1748 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
1749 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
1750 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
1751 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
1752 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
1753 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
1754 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
1755 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
1756 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
1757 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
1758 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
1759 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
1760 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
1761 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
1762 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
1763 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001764 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
1765 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
1766 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
1767 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
1768 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
1769 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +01001770 *
Paul Bakkercff68422013-09-15 20:43:33 +02001771 * PEM_PARSE uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001772 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001773#define MBEDTLS_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001774
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001775/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001776 * \def MBEDTLS_ASN1_PARSE_C
Paul Bakkerefc30292011-11-10 14:43:23 +00001777 *
1778 * Enable the generic ASN1 parser.
1779 *
1780 * Module: library/asn1.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001781 * Caller: library/x509.c
1782 * library/dhm.c
1783 * library/pkcs12.c
1784 * library/pkcs5.c
1785 * library/pkparse.c
Paul Bakkerefc30292011-11-10 14:43:23 +00001786 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001787#define MBEDTLS_ASN1_PARSE_C
Paul Bakkerefc30292011-11-10 14:43:23 +00001788
1789/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001790 * \def MBEDTLS_ASN1_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001791 *
1792 * Enable the generic ASN1 writer.
1793 *
1794 * Module: library/asn1write.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001795 * Caller: library/ecdsa.c
1796 * library/pkwrite.c
1797 * library/x509_create.c
1798 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001799 * library/x509write_csr.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001800 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001801#define MBEDTLS_ASN1_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001802
1803/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001804 * \def MBEDTLS_BASE64_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001805 *
1806 * Enable the Base64 module.
1807 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001808 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001809 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001810 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001811 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +00001812 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001813#define MBEDTLS_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001814
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001815/**
Yanray Wange367e472023-10-31 17:23:04 +08001816 * \def MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
1817 *
1818 * Remove decryption operation for AES, ARIA and Camellia block cipher.
1819 *
1820 * \note This feature is incompatible with insecure block cipher,
1821 * MBEDTLS_DES_C, and cipher modes which always require decryption
1822 * operation, MBEDTLS_CIPHER_MODE_CBC, MBEDTLS_CIPHER_MODE_XTS and
Ronald Cron93ba6252024-09-05 10:37:14 +02001823 * MBEDTLS_NIST_KW_C. This feature is incompatible with following
1824 * supported PSA equivalence PSA_WANT_ALG_ECB_NO_PADDING,
1825 * PSA_WANT_ALG_CBC_NO_PADDING, PSA_WANT_ALG_CBC_PKCS7 and
1826 * PSA_WANT_KEY_TYPE_DES.
Yanray Wange367e472023-10-31 17:23:04 +08001827 *
1828 * Module: library/aes.c
1829 * library/aesce.c
1830 * library/aesni.c
1831 * library/aria.c
1832 * library/camellia.c
1833 * library/cipher.c
1834 */
1835//#define MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
1836
1837/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001838 * \def MBEDTLS_BIGNUM_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001839 *
Paul Bakker9a736322012-11-14 12:39:52 +00001840 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001841 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001842 * Module: library/bignum.c
Janos Follath3ca07752022-08-09 11:45:47 +01001843 * library/bignum_core.c
Janos Follathd1baedb2022-08-09 13:44:53 +01001844 * library/bignum_mod.c
Gabor Mezeid41f6272022-08-12 15:20:21 +02001845 * library/bignum_mod_raw.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001846 * Caller: library/dhm.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001847 * library/ecp.c
Manuel Pégourié-Gonnardbf319772014-06-25 13:00:17 +02001848 * library/ecdsa.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001849 * library/rsa.c
Chris Jones3848e312021-03-11 16:17:59 +00001850 * library/rsa_alt_helpers.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001851 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001852 *
Manuel Pégourié-Gonnardbf319772014-06-25 13:00:17 +02001853 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
Paul Bakker5121ce52009-01-03 21:22:43 +00001854 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001855#define MBEDTLS_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001856
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001857/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001858 * \def MBEDTLS_CAMELLIA_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001859 *
1860 * Enable the Camellia block cipher.
1861 *
Paul Bakker38119b12009-01-10 23:31:23 +00001862 * Module: library/camellia.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +01001863 * Caller: library/cipher.c
Paul Bakker38119b12009-01-10 23:31:23 +00001864 *
Paul Bakker645ce3a2012-10-31 12:32:41 +00001865 * This module enables the following ciphersuites (if other requisites are
1866 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001867 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1868 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1869 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
1870 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
1871 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1872 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1873 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
1874 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
1875 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1876 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1877 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1878 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1879 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
1880 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
1881 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
1882 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1883 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1884 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1885 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1886 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1887 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1888 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1889 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
1890 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1891 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1892 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
1893 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1894 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1895 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1896 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
1897 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
1898 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
1899 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
1900 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001901 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
1902 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
1903 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
1904 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +00001905 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001906#define MBEDTLS_CAMELLIA_C
Paul Bakker38119b12009-01-10 23:31:23 +00001907
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001908/**
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001909 * \def MBEDTLS_ARIA_C
1910 *
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001911 * Enable the ARIA block cipher.
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001912 *
1913 * Module: library/aria.c
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001914 * Caller: library/cipher.c
1915 *
1916 * This module enables the following ciphersuites (if other requisites are
1917 * enabled as well):
1918 *
1919 * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256
1920 * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384
1921 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256
1922 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384
1923 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256
1924 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384
1925 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256
1926 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384
1927 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256
1928 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384
1929 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256
1930 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384
1931 * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256
1932 * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384
1933 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256
1934 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384
1935 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256
1936 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384
1937 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256
1938 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384
1939 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256
1940 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384
1941 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256
1942 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384
1943 * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256
1944 * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384
1945 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256
1946 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001947 * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256
1948 * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384
1949 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256
1950 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001951 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256
1952 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001953 */
TRodziewicz85aff9f2021-04-23 10:47:26 +02001954#define MBEDTLS_ARIA_C
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001955
1956/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001957 * \def MBEDTLS_CCM_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001958 *
1959 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
1960 *
1961 * Module: library/ccm.c
1962 *
Przemek Stekielea805b42022-05-02 10:30:03 +02001963 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or
1964 * MBEDTLS_ARIA_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001965 *
1966 * This module enables the AES-CCM ciphersuites, if other requisites are
1967 * enabled as well.
1968 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001969#define MBEDTLS_CCM_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001970
1971/**
Daniel King34b822c2016-05-15 17:28:08 -03001972 * \def MBEDTLS_CHACHA20_C
1973 *
1974 * Enable the ChaCha20 stream cipher.
1975 *
1976 * Module: library/chacha20.c
1977 */
1978#define MBEDTLS_CHACHA20_C
1979
1980/**
Manuel Pégourié-Gonnarde533b222018-06-04 12:23:19 +02001981 * \def MBEDTLS_CHACHAPOLY_C
1982 *
1983 * Enable the ChaCha20-Poly1305 AEAD algorithm.
1984 *
1985 * Module: library/chachapoly.c
1986 *
1987 * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
1988 */
1989#define MBEDTLS_CHACHAPOLY_C
1990
1991/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001992 * \def MBEDTLS_CIPHER_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001993 *
1994 * Enable the generic cipher layer.
1995 *
Paul Bakker8123e9d2011-01-06 15:37:30 +00001996 * Module: library/cipher.c
Przemek Stekielea805b42022-05-02 10:30:03 +02001997 * Caller: library/ccm.c
1998 * library/cmac.c
1999 * library/gcm.c
2000 * library/nist_kw.c
Przemek Stekielea805b42022-05-02 10:30:03 +02002001 * library/pkcs12.c
2002 * library/pkcs5.c
2003 * library/psa_crypto_aead.c
2004 * library/psa_crypto_mac.c
2005 * library/ssl_ciphersuites.c
2006 * library/ssl_msg.c
Valerio Settid5cab812023-12-28 10:04:51 +01002007 * Auto-enabled by: MBEDTLS_PSA_CRYPTO_C depending on which ciphers are enabled
2008 * (see the documentation of that option for details).
Paul Bakker8123e9d2011-01-06 15:37:30 +00002009 *
2010 * Uncomment to enable generic cipher wrappers.
2011 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002012#define MBEDTLS_CIPHER_C
Paul Bakker8123e9d2011-01-06 15:37:30 +00002013
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002014/**
Robert Cragiedc5c7b92015-12-11 15:49:45 +00002015 * \def MBEDTLS_CMAC_C
2016 *
Simon Butcher327398a2016-10-05 14:09:11 +01002017 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
2018 * ciphers.
Robert Cragiedc5c7b92015-12-11 15:49:45 +00002019 *
2020 * Module: library/cmac.c
2021 *
Przemek Stekielea805b42022-05-02 10:30:03 +02002022 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_DES_C
Robert Cragiedc5c7b92015-12-11 15:49:45 +00002023 *
2024 */
TRodziewicz85aff9f2021-04-23 10:47:26 +02002025#define MBEDTLS_CMAC_C
Robert Cragiedc5c7b92015-12-11 15:49:45 +00002026
2027/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002028 * \def MBEDTLS_CTR_DRBG_C
Paul Bakker0e04d0e2011-11-27 14:46:59 +00002029 *
Nir Sonnenscheince266e42018-08-29 10:11:46 +03002030 * Enable the CTR_DRBG AES-based random generator.
2031 * The CTR_DRBG generator uses AES-256 by default.
Gilles Peskine1540e5b2019-10-03 14:21:14 +02002032 * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above.
Paul Bakker0e04d0e2011-11-27 14:46:59 +00002033 *
Wenxing Houb4d03cc2024-06-19 11:04:13 +08002034 * AES support can either be achieved through builtin (MBEDTLS_AES_C) or PSA.
Valerio Setti7ab90722023-11-23 16:29:51 +01002035 * Builtin is the default option when MBEDTLS_AES_C is defined otherwise PSA
2036 * is used.
2037 *
2038 * \warning When using PSA, the user should call `psa_crypto_init()` before
2039 * using any CTR_DRBG operation (except `mbedtls_ctr_drbg_init()`).
2040 *
Yanray Wang55ef22c2023-06-15 09:57:06 +08002041 * \note AES-128 will be used if \c MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH is set.
2042 *
Gilles Peskine7e279362019-10-03 14:21:39 +02002043 * \note To achieve a 256-bit security strength with CTR_DRBG,
2044 * you must use AES-256 *and* use sufficient entropy.
2045 * See ctr_drbg.h for more details.
Paul Bakker0e04d0e2011-11-27 14:46:59 +00002046 *
2047 * Module: library/ctr_drbg.c
2048 * Caller:
2049 *
Valerio Setti7ab90722023-11-23 16:29:51 +01002050 * Requires: MBEDTLS_AES_C or
2051 * (PSA_WANT_KEY_TYPE_AES and PSA_WANT_ALG_ECB_NO_PADDING and
2052 * MBEDTLS_PSA_CRYPTO_C)
Paul Bakker6083fd22011-12-03 21:45:14 +00002053 *
Nir Sonnenschein521e8a92018-09-03 14:10:52 +03002054 * This module provides the CTR_DRBG AES random number generator.
Paul Bakker0e04d0e2011-11-27 14:46:59 +00002055 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002056#define MBEDTLS_CTR_DRBG_C
Paul Bakker0e04d0e2011-11-27 14:46:59 +00002057
2058/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002059 * \def MBEDTLS_DEBUG_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002060 *
2061 * Enable the debug functions.
2062 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002063 * Module: library/debug.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002064 * Caller: library/ssl_msg.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002065 * library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002066 * library/ssl_tls12_*.c
2067 * library/ssl_tls13_*.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002068 *
2069 * This module provides debugging functions.
2070 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002071#define MBEDTLS_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002072
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002073/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002074 * \def MBEDTLS_DES_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002075 *
2076 * Enable the DES block cipher.
2077 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002078 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01002079 * Caller: library/pem.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +01002080 * library/cipher.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002081 *
Paul Bakkercff68422013-09-15 20:43:33 +02002082 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002083 *
Dave Rodgmanc04515b2023-02-02 10:47:58 +00002084 * \warning DES/3DES are considered weak ciphers and their use constitutes a
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002085 * security risk. We recommend considering stronger ciphers instead.
Paul Bakker5121ce52009-01-03 21:22:43 +00002086 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002087#define MBEDTLS_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002088
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002089/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002090 * \def MBEDTLS_DHM_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002091 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02002092 * Enable the Diffie-Hellman-Merkle module.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002093 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002094 * Module: library/dhm.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002095 * Caller: library/ssl_tls.c
2096 * library/ssl*_client.c
2097 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002098 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02002099 * This module is used by the following key exchanges:
2100 * DHE-RSA, DHE-PSK
Hanno Beckera2f6b722017-09-28 10:33:29 +01002101 *
Hanno Beckerf9734b32017-10-03 12:09:22 +01002102 * \warning Using DHE constitutes a security risk as it
2103 * is not possible to validate custom DH parameters.
2104 * If possible, it is recommended users should consider
2105 * preferring other methods of key exchange.
2106 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +01002107 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002108 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002109#define MBEDTLS_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002110
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002111/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002112 * \def MBEDTLS_ECDH_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002113 *
2114 * Enable the elliptic curve Diffie-Hellman library.
2115 *
2116 * Module: library/ecdh.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002117 * Caller: library/psa_crypto.c
2118 * library/ssl_tls.c
2119 * library/ssl*_client.c
2120 * library/ssl*_server.c
Paul Bakker41c83d32013-03-20 14:39:14 +01002121 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02002122 * This module is used by the following key exchanges:
2123 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002124 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002125 * Requires: MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002126 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002127#define MBEDTLS_ECDH_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002128
2129/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002130 * \def MBEDTLS_ECDSA_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002131 *
2132 * Enable the elliptic curve DSA library.
2133 *
2134 * Module: library/ecdsa.c
2135 * Caller:
2136 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02002137 * This module is used by the following key exchanges:
2138 * ECDHE-ECDSA
2139 *
Gilles Peskine799e5762018-09-14 17:34:00 +02002140 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C,
2141 * and at least one MBEDTLS_ECP_DP_XXX_ENABLED for a
2142 * short Weierstrass curve.
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002143 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002144#define MBEDTLS_ECDSA_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002145
2146/**
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02002147 * \def MBEDTLS_ECJPAKE_C
2148 *
2149 * Enable the elliptic curve J-PAKE library.
2150 *
Tomasz Rodziewicz532ca932021-05-07 11:01:24 +02002151 * \note EC J-PAKE support is based on the Thread v1.0.0 specification.
2152 * It has not been reviewed for compliance with newer standards such as
Tomasz Rodziewicz1fc7c4c2021-05-07 10:13:31 +02002153 * Thread v1.1 or RFC 8236.
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +02002154 *
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02002155 * Module: library/ecjpake.c
2156 * Caller:
2157 *
2158 * This module is used by the following key exchanges:
2159 * ECJPAKE
2160 *
Manuel Pégourié-Gonnard72687b72022-09-15 12:23:58 +02002161 * Requires: MBEDTLS_ECP_C and either MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C
Neil Armstrongecaba1c2022-08-11 10:47:08 +02002162 *
Manuel Pégourié-Gonnard41bc8b62023-03-14 23:59:24 +01002163 * \warning If using a hash that is only provided by PSA drivers, you must
2164 * call psa_crypto_init() before doing any EC J-PAKE operations.
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02002165 */
Tomasz Rodziewiczb1336052021-04-22 15:14:17 +02002166#define MBEDTLS_ECJPAKE_C
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02002167
2168/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002169 * \def MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002170 *
2171 * Enable the elliptic curve over GF(p) library.
2172 *
2173 * Module: library/ecp.c
2174 * Caller: library/ecdh.c
2175 * library/ecdsa.c
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02002176 * library/ecjpake.c
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002177 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002178 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002179 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002180#define MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01002181
2182/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002183 * \def MBEDTLS_ENTROPY_C
Paul Bakker6083fd22011-12-03 21:45:14 +00002184 *
2185 * Enable the platform-specific entropy code.
2186 *
2187 * Module: library/entropy.c
2188 * Caller:
2189 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002190 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
Paul Bakker6083fd22011-12-03 21:45:14 +00002191 *
2192 * This module provides a generic entropy pool
2193 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002194#define MBEDTLS_ENTROPY_C
Paul Bakker6083fd22011-12-03 21:45:14 +00002195
2196/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002197 * \def MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +00002198 *
2199 * Enable error code to error string conversion.
2200 *
2201 * Module: library/error.c
2202 * Caller:
2203 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002204 * This module enables mbedtls_strerror().
Paul Bakker9d781402011-05-09 16:17:09 +00002205 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002206#define MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +00002207
2208/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002209 * \def MBEDTLS_GCM_C
Paul Bakker89e80c92012-03-20 13:50:09 +00002210 *
Jaeden Amero7accf442019-04-10 18:13:57 +01002211 * Enable the Galois/Counter Mode (GCM).
Paul Bakker89e80c92012-03-20 13:50:09 +00002212 *
2213 * Module: library/gcm.c
2214 *
Przemek Stekielea805b42022-05-02 10:30:03 +02002215 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or
2216 * MBEDTLS_ARIA_C
Paul Bakker645ce3a2012-10-31 12:32:41 +00002217 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02002218 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
2219 * requisites are enabled as well.
Paul Bakker89e80c92012-03-20 13:50:09 +00002220 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002221#define MBEDTLS_GCM_C
Paul Bakker89e80c92012-03-20 13:50:09 +00002222
2223/**
Matthias Schulza6ac0f12024-02-09 17:09:42 +01002224 * \def MBEDTLS_GCM_LARGE_TABLE
Matthias Schulz0767fda2024-02-07 10:46:28 +01002225 *
Matthias Schulzf3116342024-02-08 18:35:36 +01002226 * Enable large pre-computed tables for Galois/Counter Mode (GCM).
Matthias Schulz0767fda2024-02-07 10:46:28 +01002227 * Can significantly increase throughput on systems without GCM hardware
2228 * acceleration (e.g., AESNI, AESCE).
2229 *
Matthias Schulz78266782024-02-08 13:54:48 +01002230 * The mbedtls_gcm_context size will increase by 3840 bytes.
2231 * The code size will increase by roughly 344 bytes.
2232 *
Matthias Schulz0767fda2024-02-07 10:46:28 +01002233 * Module: library/gcm.c
2234 *
2235 * Requires: MBEDTLS_GCM_C
Matthias Schulz0767fda2024-02-07 10:46:28 +01002236 */
Matthias Schulza6ac0f12024-02-09 17:09:42 +01002237//#define MBEDTLS_GCM_LARGE_TABLE
Matthias Schulz0767fda2024-02-07 10:46:28 +01002238
2239/**
Thomas Fossati656864b2016-07-17 08:51:22 +01002240 * \def MBEDTLS_HKDF_C
2241 *
2242 * Enable the HKDF algorithm (RFC 5869).
2243 *
2244 * Module: library/hkdf.c
2245 * Caller:
2246 *
2247 * Requires: MBEDTLS_MD_C
2248 *
2249 * This module adds support for the Hashed Message Authentication Code
2250 * (HMAC)-based key derivation function (HKDF).
2251 */
2252#define MBEDTLS_HKDF_C
2253
2254/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002255 * \def MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01002256 *
2257 * Enable the HMAC_DRBG random generator.
2258 *
2259 * Module: library/hmac_drbg.c
2260 * Caller:
2261 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002262 * Requires: MBEDTLS_MD_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01002263 *
Tom Cosgrove1e211442022-05-26 11:51:00 +01002264 * Uncomment to enable the HMAC_DRBG random number generator.
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01002265 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002266#define MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01002267
2268/**
Raef Coles8ff6df52021-07-21 12:42:15 +01002269 * \def MBEDTLS_LMS_C
2270 *
2271 * Enable the LMS stateful-hash asymmetric signature algorithm.
2272 *
2273 * Module: library/lms.c
2274 * Caller:
2275 *
Raef Colesab4f8742022-09-01 12:24:31 +01002276 * Requires: MBEDTLS_PSA_CRYPTO_C
Raef Coles8ff6df52021-07-21 12:42:15 +01002277 *
Raef Colesab4f8742022-09-01 12:24:31 +01002278 * Uncomment to enable the LMS verification algorithm and public key operations.
Raef Coles8ff6df52021-07-21 12:42:15 +01002279 */
2280#define MBEDTLS_LMS_C
2281
2282/**
Raef Colesab4f8742022-09-01 12:24:31 +01002283 * \def MBEDTLS_LMS_PRIVATE
2284 *
2285 * Enable LMS private-key operations and signing code. Functions enabled by this
2286 * option are experimental, and should not be used in production.
2287 *
2288 * Requires: MBEDTLS_LMS_C
2289 *
2290 * Uncomment to enable the LMS signature algorithm and private key operations.
2291 */
Raef Coles5127e852022-10-07 10:35:56 +01002292//#define MBEDTLS_LMS_PRIVATE
Raef Colesab4f8742022-09-01 12:24:31 +01002293
2294/**
Ron Eldor466a57f2018-05-03 16:54:28 +03002295 * \def MBEDTLS_NIST_KW_C
2296 *
2297 * Enable the Key Wrapping mode for 128-bit block ciphers,
2298 * as defined in NIST SP 800-38F. Only KW and KWP modes
2299 * are supported. At the moment, only AES is approved by NIST.
2300 *
2301 * Module: library/nist_kw.c
2302 *
2303 * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C
2304 */
TRodziewicz85aff9f2021-04-23 10:47:26 +02002305#define MBEDTLS_NIST_KW_C
Ron Eldor466a57f2018-05-03 16:54:28 +03002306
2307/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002308 * \def MBEDTLS_MD_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002309 *
Manuel Pégourié-Gonnardb9b630d2023-02-16 19:07:31 +01002310 * Enable the generic layer for message digest (hashing) and HMAC.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002311 *
Manuel Pégourié-Gonnard1f7f7172022-07-18 12:04:05 +02002312 * Requires: one of: MBEDTLS_MD5_C, MBEDTLS_RIPEMD160_C, MBEDTLS_SHA1_C,
2313 * MBEDTLS_SHA224_C, MBEDTLS_SHA256_C, MBEDTLS_SHA384_C,
Manuel Pégourié-Gonnard161dca62023-03-21 16:22:59 +01002314 * MBEDTLS_SHA512_C, or MBEDTLS_PSA_CRYPTO_C with at least
Manuel Pégourié-Gonnard534d64d2023-03-14 17:43:06 +01002315 * one hash.
Simon Butcher2cb47392016-11-04 12:23:11 +00002316 * Module: library/md.c
Przemek Stekiel6aadf0b2022-04-27 14:46:52 +02002317 * Caller: library/constant_time.c
2318 * library/ecdsa.c
2319 * library/ecjpake.c
2320 * library/hkdf.c
2321 * library/hmac_drbg.c
Przemek Stekiel6aadf0b2022-04-27 14:46:52 +02002322 * library/pk.c
2323 * library/pkcs5.c
2324 * library/pkcs12.c
2325 * library/psa_crypto_ecp.c
2326 * library/psa_crypto_rsa.c
2327 * library/rsa.c
2328 * library/ssl_cookie.c
2329 * library/ssl_msg.c
2330 * library/ssl_tls.c
Przemek Stekiel6e712822022-05-06 11:40:20 +02002331 * library/x509.c
Przemek Stekiel6aadf0b2022-04-27 14:46:52 +02002332 * library/x509_crt.c
2333 * library/x509write_crt.c
2334 * library/x509write_csr.c
Paul Bakker17373852011-01-06 14:20:01 +00002335 *
2336 * Uncomment to enable generic message digest wrappers.
2337 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002338#define MBEDTLS_MD_C
Paul Bakker17373852011-01-06 14:20:01 +00002339
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002340/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002341 * \def MBEDTLS_MD5_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002342 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002343 * Enable the MD5 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002344 *
Simon Butcher2cb47392016-11-04 12:23:11 +00002345 * Module: library/md5.c
2346 * Caller: library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002347 * library/pem.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01002348 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002349 *
TRodziewicz0f82ec62021-05-12 17:49:18 +02002350 * This module is required for TLS 1.2 depending on the handshake parameters.
2351 * Further, it is used for checking MD5-signed certificates, and for PBKDF1
2352 * when decrypting PEM-encoded encrypted keys.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002353 *
2354 * \warning MD5 is considered a weak message digest and its use constitutes a
2355 * security risk. If possible, we recommend avoiding dependencies on
2356 * it, and considering stronger message digests instead.
2357 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002358 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002359#define MBEDTLS_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002360
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002361/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002362 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002363 *
2364 * Enable the buffer allocator implementation that makes use of a (stack)
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02002365 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002366 * calls)
Paul Bakker6e339b52013-07-03 13:37:05 +02002367 *
2368 * Module: library/memory_buffer_alloc.c
2369 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002370 * Requires: MBEDTLS_PLATFORM_C
Gilles Peskinee820c0a2023-08-03 17:45:20 +02002371 * MBEDTLS_PLATFORM_MEMORY (to use it within Mbed TLS)
Paul Bakker6e339b52013-07-03 13:37:05 +02002372 *
2373 * Enable this module to enable the buffer memory allocator.
Paul Bakker6e339b52013-07-03 13:37:05 +02002374 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002375//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +02002376
2377/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002378 * \def MBEDTLS_NET_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002379 *
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01002380 * Enable the TCP and UDP over IPv6/IPv4 networking routines.
2381 *
Simon Butcherd567a232016-03-09 20:19:21 +00002382 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
2383 * and Windows. For other platforms, you'll want to disable it, and write your
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01002384 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002385 *
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00002386 * \note See also our Knowledge Base article about porting to a new
2387 * environment:
Dave Rodgmanb3196842022-10-12 16:47:08 +01002388 * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00002389 *
Andres AG788aa4a2016-09-14 14:32:09 +01002390 * Module: library/net_sockets.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002391 *
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01002392 * This module provides networking routines.
Paul Bakker5121ce52009-01-03 21:22:43 +00002393 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002394#define MBEDTLS_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002395
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002396/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002397 * \def MBEDTLS_OID_C
Paul Bakkerc70b9822013-04-07 22:00:46 +02002398 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002399 * Enable the OID database.
Paul Bakkerc70b9822013-04-07 22:00:46 +02002400 *
2401 * Module: library/oid.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002402 * Caller: library/asn1write.c
2403 * library/pkcs5.c
2404 * library/pkparse.c
2405 * library/pkwrite.c
2406 * library/rsa.c
2407 * library/x509.c
2408 * library/x509_create.c
Simon Butcher2cb47392016-11-04 12:23:11 +00002409 * library/x509_crl.c
2410 * library/x509_crt.c
2411 * library/x509_csr.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002412 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00002413 * library/x509write_csr.c
Paul Bakkerc70b9822013-04-07 22:00:46 +02002414 *
2415 * This modules translates between OIDs and internal values.
2416 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002417#define MBEDTLS_OID_C
Paul Bakkerc70b9822013-04-07 22:00:46 +02002418
2419/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002420 * \def MBEDTLS_PEM_PARSE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00002421 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002422 * Enable PEM decoding / parsing.
Paul Bakker96743fc2011-02-12 14:30:57 +00002423 *
2424 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002425 * Caller: library/dhm.c
Paul Bakkercff68422013-09-15 20:43:33 +02002426 * library/pkparse.c
Simon Butcher2cb47392016-11-04 12:23:11 +00002427 * library/x509_crl.c
2428 * library/x509_crt.c
2429 * library/x509_csr.c
Paul Bakker96743fc2011-02-12 14:30:57 +00002430 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002431 * Requires: MBEDTLS_BASE64_C
Manuel Pégourié-Gonnard1c2008f2023-03-16 10:20:29 +01002432 * optionally MBEDTLS_MD5_C, or PSA Crypto with MD5 (see below)
2433 *
2434 * \warning When parsing password-protected files, if MD5 is provided only by
2435 * a PSA driver, you must call psa_crypto_init() before the first file.
Paul Bakker5690efc2011-05-26 13:16:06 +00002436 *
Paul Bakkercff68422013-09-15 20:43:33 +02002437 * This modules adds support for decoding / parsing PEM files.
Paul Bakker96743fc2011-02-12 14:30:57 +00002438 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002439#define MBEDTLS_PEM_PARSE_C
Paul Bakkercff68422013-09-15 20:43:33 +02002440
2441/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002442 * \def MBEDTLS_PEM_WRITE_C
Paul Bakkercff68422013-09-15 20:43:33 +02002443 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002444 * Enable PEM encoding / writing.
Paul Bakkercff68422013-09-15 20:43:33 +02002445 *
2446 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002447 * Caller: library/pkwrite.c
2448 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00002449 * library/x509write_csr.c
Paul Bakkercff68422013-09-15 20:43:33 +02002450 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002451 * Requires: MBEDTLS_BASE64_C
Paul Bakkercff68422013-09-15 20:43:33 +02002452 *
2453 * This modules adds support for encoding / writing PEM files.
2454 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002455#define MBEDTLS_PEM_WRITE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00002456
2457/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002458 * \def MBEDTLS_PK_C
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02002459 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -08002460 * Enable the generic public (asymmetric) key layer.
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02002461 *
2462 * Module: library/pk.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002463 * Caller: library/psa_crypto_rsa.c
2464 * library/ssl_tls.c
2465 * library/ssl*_client.c
2466 * library/ssl*_server.c
2467 * library/x509.c
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02002468 *
Przemek Stekiel6aadf0b2022-04-27 14:46:52 +02002469 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C or MBEDTLS_ECP_C
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02002470 *
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02002471 * Uncomment to enable generic public key wrappers.
2472 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002473#define MBEDTLS_PK_C
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02002474
2475/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002476 * \def MBEDTLS_PK_PARSE_C
Paul Bakker4606c732013-09-15 17:04:23 +02002477 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -08002478 * Enable the generic public (asymmetric) key parser.
Paul Bakker4606c732013-09-15 17:04:23 +02002479 *
2480 * Module: library/pkparse.c
Simon Butcher2cb47392016-11-04 12:23:11 +00002481 * Caller: library/x509_crt.c
2482 * library/x509_csr.c
Paul Bakker4606c732013-09-15 17:04:23 +02002483 *
Yanray Wang072a0682023-12-05 10:53:04 +08002484 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_C
Paul Bakker4606c732013-09-15 17:04:23 +02002485 *
2486 * Uncomment to enable generic public key parse functions.
2487 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002488#define MBEDTLS_PK_PARSE_C
Paul Bakker4606c732013-09-15 17:04:23 +02002489
2490/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002491 * \def MBEDTLS_PK_WRITE_C
Paul Bakker4606c732013-09-15 17:04:23 +02002492 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -08002493 * Enable the generic public (asymmetric) key writer.
Paul Bakker4606c732013-09-15 17:04:23 +02002494 *
2495 * Module: library/pkwrite.c
2496 * Caller: library/x509write.c
2497 *
Yanray Wanga8f8eb12023-12-05 11:00:33 +08002498 * Requires: MBEDTLS_ASN1_WRITE_C, MBEDTLS_OID_C, MBEDTLS_PK_C
Paul Bakker4606c732013-09-15 17:04:23 +02002499 *
2500 * Uncomment to enable generic public key write functions.
2501 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002502#define MBEDTLS_PK_WRITE_C
Paul Bakker4606c732013-09-15 17:04:23 +02002503
2504/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002505 * \def MBEDTLS_PKCS5_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02002506 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002507 * Enable PKCS#5 functions.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02002508 *
2509 * Module: library/pkcs5.c
2510 *
Manuel Pégourié-Gonnard161dca62023-03-21 16:22:59 +01002511 * Auto-enables: MBEDTLS_MD_C
Manuel Pégourié-Gonnard72687b72022-09-15 12:23:58 +02002512 *
Manuel Pégourié-Gonnard49e67f82023-03-16 11:39:20 +01002513 * \warning If using a hash that is only provided by PSA drivers, you must
2514 * call psa_crypto_init() before doing any PKCS5 operations.
Manuel Pégourié-Gonnard18a38562022-11-22 11:49:55 +01002515 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02002516 * This module adds support for the PKCS#5 functions.
2517 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002518#define MBEDTLS_PKCS5_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02002519
2520/**
Nayna Jainc9deb182020-11-16 19:03:12 +00002521 * \def MBEDTLS_PKCS7_C
2522 *
Dave Rodgman3fe2abf2023-03-10 17:05:54 +00002523 * Enable PKCS #7 core for using PKCS #7-formatted signatures.
Nayna Jainc9deb182020-11-16 19:03:12 +00002524 * RFC Link - https://tools.ietf.org/html/rfc2315
2525 *
2526 * Module: library/pkcs7.c
2527 *
2528 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
Nick Child89e82e12022-11-09 10:36:10 -06002529 * MBEDTLS_X509_CRT_PARSE_C MBEDTLS_X509_CRL_PARSE_C,
2530 * MBEDTLS_BIGNUM_C, MBEDTLS_MD_C
Nayna Jainc9deb182020-11-16 19:03:12 +00002531 *
Dave Rodgmanefbc5f72023-03-13 12:15:49 +00002532 * This module is required for the PKCS #7 parsing modules.
Nayna Jainc9deb182020-11-16 19:03:12 +00002533 */
Dave Rodgman7c33b0c2023-03-10 15:07:15 +00002534#define MBEDTLS_PKCS7_C
Nayna Jainc9deb182020-11-16 19:03:12 +00002535
2536/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002537 * \def MBEDTLS_PKCS12_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02002538 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02002539 * Enable PKCS#12 PBE functions.
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02002540 * Adds algorithms for parsing PKCS#8 encrypted private keys
2541 *
2542 * Module: library/pkcs12.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002543 * Caller: library/pkparse.c
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02002544 *
Valerio Settie98ad592023-12-28 10:42:12 +01002545 * Requires: MBEDTLS_ASN1_PARSE_C and either MBEDTLS_MD_C or
2546 * MBEDTLS_PSA_CRYPTO_C.
Andrzej Kurek7bd12c52022-08-24 10:47:10 -04002547 *
Manuel Pégourié-Gonnardbe97afe2023-03-16 10:00:54 +01002548 * \warning If using a hash that is only provided by PSA drivers, you must
2549 * call psa_crypto_init() before doing any PKCS12 operations.
Manuel Pégourié-Gonnard18a38562022-11-22 11:49:55 +01002550 *
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02002551 * This module enables PKCS#12 functions.
2552 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002553#define MBEDTLS_PKCS12_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02002554
2555/**
Daniel Kingadc32c02016-05-16 18:25:45 -03002556 * \def MBEDTLS_POLY1305_C
2557 *
2558 * Enable the Poly1305 MAC algorithm.
2559 *
2560 * Module: library/poly1305.c
Manuel Pégourié-Gonnarddca3a5d2018-05-07 10:43:27 +02002561 * Caller: library/chachapoly.c
Daniel Kingadc32c02016-05-16 18:25:45 -03002562 */
2563#define MBEDTLS_POLY1305_C
2564
2565/**
Jaeden Amero484ee332018-10-25 17:38:05 +01002566 * \def MBEDTLS_PSA_CRYPTO_C
2567 *
2568 * Enable the Platform Security Architecture cryptography API.
2569 *
Gilles Peskinee59236f2018-01-27 23:32:46 +01002570 * Module: library/psa_crypto.c
Jaeden Amero484ee332018-10-25 17:38:05 +01002571 *
Valerio Setti7ab90722023-11-23 16:29:51 +01002572 * Requires: either MBEDTLS_CTR_DRBG_C and MBEDTLS_ENTROPY_C,
Gilles Peskine82e57d12020-11-13 21:31:17 +01002573 * or MBEDTLS_HMAC_DRBG_C and MBEDTLS_ENTROPY_C,
Valerio Settid5cab812023-12-28 10:04:51 +01002574 * or MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG.
2575 * Auto-enables: MBEDTLS_CIPHER_C if any unauthenticated (ie, non-AEAD) cipher
2576 * is enabled in PSA (unless it's fully accelerated, see
2577 * docs/driver-only-builds.md about that).
Jaeden Amero484ee332018-10-25 17:38:05 +01002578 */
Manuel Pégourié-Gonnardde7636e2019-02-01 12:33:29 +01002579#define MBEDTLS_PSA_CRYPTO_C
Jaeden Amero484ee332018-10-25 17:38:05 +01002580
2581/**
Gilles Peskinea8ade162019-06-26 11:24:49 +02002582 * \def MBEDTLS_PSA_CRYPTO_SE_C
2583 *
Gilles Peskine98473c42022-06-20 18:46:22 +02002584 * Enable dynamic secure element support in the Platform Security Architecture
Gilles Peskinea8ade162019-06-26 11:24:49 +02002585 * cryptography API.
2586 *
Ronald Crone6e6b752023-01-16 16:56:51 +01002587 * \deprecated This feature is deprecated. Please switch to the PSA driver
2588 * interface.
Gilles Peskined0e66b02019-07-24 13:52:51 +02002589 *
Ryan Everett32a64582024-03-05 18:16:18 +00002590 * \warning This feature is not thread-safe, and should not be used in a
2591 * multi-threaded environment.
2592 *
Gilles Peskinea8ade162019-06-26 11:24:49 +02002593 * Module: library/psa_crypto_se.c
2594 *
2595 * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_CRYPTO_STORAGE_C
2596 *
2597 */
Gilles Peskined0e66b02019-07-24 13:52:51 +02002598//#define MBEDTLS_PSA_CRYPTO_SE_C
Gilles Peskinea8ade162019-06-26 11:24:49 +02002599
2600/**
Andrzej Kurekc6905232019-02-05 05:23:41 -05002601 * \def MBEDTLS_PSA_CRYPTO_STORAGE_C
2602 *
2603 * Enable the Platform Security Architecture persistent key storage.
2604 *
Darryl Greendb2b8db2018-06-15 13:06:04 +01002605 * Module: library/psa_crypto_storage.c
Andrzej Kurekc6905232019-02-05 05:23:41 -05002606 *
Jaeden Amero57f4d9e2019-03-15 16:14:19 +00002607 * Requires: MBEDTLS_PSA_CRYPTO_C,
2608 * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of
2609 * the PSA ITS interface
Andrzej Kurekc6905232019-02-05 05:23:41 -05002610 */
Darryl Greendb2b8db2018-06-15 13:06:04 +01002611#define MBEDTLS_PSA_CRYPTO_STORAGE_C
Andrzej Kurekc6905232019-02-05 05:23:41 -05002612
2613/**
Jaeden Amero57f4d9e2019-03-15 16:14:19 +00002614 * \def MBEDTLS_PSA_ITS_FILE_C
Andrzej Kurekc6905232019-02-05 05:23:41 -05002615 *
Jaeden Amero57f4d9e2019-03-15 16:14:19 +00002616 * Enable the emulation of the Platform Security Architecture
2617 * Internal Trusted Storage (PSA ITS) over files.
Andrzej Kurekc6905232019-02-05 05:23:41 -05002618 *
Gilles Peskine6194dc22018-11-16 22:24:15 +01002619 * Module: library/psa_its_file.c
Andrzej Kurekc6905232019-02-05 05:23:41 -05002620 *
Jaeden Amero57f4d9e2019-03-15 16:14:19 +00002621 * Requires: MBEDTLS_FS_IO
Andrzej Kurekc6905232019-02-05 05:23:41 -05002622 */
Gilles Peskine6194dc22018-11-16 22:24:15 +01002623#define MBEDTLS_PSA_ITS_FILE_C
Andrzej Kurekc6905232019-02-05 05:23:41 -05002624
2625/**
Valerio Setti678e0fb2024-06-14 07:49:05 +02002626 * \def MBEDTLS_PSA_STATIC_KEY_SLOTS
2627 *
Valerio Setti933b7692024-08-13 11:08:26 +02002628 * Statically preallocate memory to store keys' material in PSA instead
2629 * of allocating it dynamically when required. This allows builds without a
2630 * heap, if none of the enabled cryptographic implementations or other features
2631 * require it.
2632 * This feature affects both volatile and persistent keys which means that
2633 * it's not possible to persistently store a key which is larger than
Valerio Settic2a6e8b2024-08-16 07:58:02 +02002634 * #MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE.
Valerio Setti678e0fb2024-06-14 07:49:05 +02002635 *
2636 * \note This feature comes with a (potentially) higher RAM usage since:
Valerio Setti83778d72024-10-04 13:46:37 +02002637 * - All the key slots are allocated no matter if they are used or not.
Valerio Settic2a6e8b2024-08-16 07:58:02 +02002638 * - Each key buffer's length is #MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE bytes.
Valerio Setti678e0fb2024-06-14 07:49:05 +02002639 *
2640 * Requires: MBEDTLS_PSA_CRYPTO_C
2641 *
2642 */
2643//#define MBEDTLS_PSA_STATIC_KEY_SLOTS
2644
2645/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002646 * \def MBEDTLS_RIPEMD160_C
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01002647 *
2648 * Enable the RIPEMD-160 hash algorithm.
2649 *
Simon Butcher2cb47392016-11-04 12:23:11 +00002650 * Module: library/ripemd160.c
2651 * Caller: library/md.c
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01002652 *
2653 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002654#define MBEDTLS_RIPEMD160_C
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01002655
2656/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002657 * \def MBEDTLS_RSA_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002658 *
2659 * Enable the RSA public-key cryptosystem.
2660 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002661 * Module: library/rsa.c
Chris Jones3848e312021-03-11 16:17:59 +00002662 * library/rsa_alt_helpers.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002663 * Caller: library/pk.c
2664 * library/psa_crypto.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002665 * library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002666 * library/ssl*_client.c
2667 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002668 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02002669 * This module is used by the following key exchanges:
Gilles Peskineb3ec1252024-09-20 18:22:04 +02002670 * RSA, DHE-RSA, ECDHE-RSA
Paul Bakker5690efc2011-05-26 13:16:06 +00002671 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002672 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002673 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002674#define MBEDTLS_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002675
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002676/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002677 * \def MBEDTLS_SHA1_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002678 *
2679 * Enable the SHA1 cryptographic hash algorithm.
2680 *
Simon Butcher2cb47392016-11-04 12:23:11 +00002681 * Module: library/sha1.c
2682 * Caller: library/md.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002683 * library/psa_crypto_hash.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002684 *
TRodziewicz0f82ec62021-05-12 17:49:18 +02002685 * This module is required for TLS 1.2 depending on the handshake parameters,
2686 * and for SHA1-signed certificates.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002687 *
2688 * \warning SHA-1 is considered a weak message digest and its use constitutes
2689 * a security risk. If possible, we recommend avoiding dependencies
2690 * on it, and considering stronger message digests instead.
2691 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002692 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002693#define MBEDTLS_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002694
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002695/**
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002696 * \def MBEDTLS_SHA224_C
2697 *
2698 * Enable the SHA-224 cryptographic hash algorithm.
2699 *
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002700 * Module: library/sha256.c
2701 * Caller: library/md.c
2702 * library/ssl_cookie.c
2703 *
2704 * This module adds support for SHA-224.
2705 */
2706#define MBEDTLS_SHA224_C
2707
2708/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002709 * \def MBEDTLS_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002710 *
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002711 * Enable the SHA-256 cryptographic hash algorithm.
2712 *
Simon Butcher2cb47392016-11-04 12:23:11 +00002713 * Module: library/sha256.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002714 * Caller: library/entropy.c
Simon Butcher2cb47392016-11-04 12:23:11 +00002715 * library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002716 * library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002717 * library/ssl*_client.c
2718 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002719 *
Mateusz Starzyke3c48b42021-04-19 16:46:28 +02002720 * This module adds support for SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01002721 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00002722 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002723#define MBEDTLS_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002724
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002725/**
Dave Rodgman5b89c552023-10-10 14:59:02 +01002726 * \def MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002727 *
Gilles Peskine9b3278b2022-06-09 19:09:38 +02002728 * Enable acceleration of the SHA-256 and SHA-224 cryptographic hash algorithms
2729 * with the ARMv8 cryptographic extensions if they are available at runtime.
2730 * If not, the library will fall back to the C implementation.
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002731 *
Dave Rodgman5b89c552023-10-10 14:59:02 +01002732 * \note If MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT is defined when building
Dave Rodgmanf097bef2023-10-10 14:56:35 +01002733 * for a non-Armv8-A build it will be silently ignored.
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002734 *
Jerry Yu8bfa24b2023-05-05 14:35:00 +08002735 * \note Minimum compiler versions for this feature are Clang 4.0,
2736 * armclang 6.6 or GCC 6.0.
2737 *
2738 * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for
2739 * armclang <= 6.9
2740 *
Dave Rodgman94a634d2023-10-10 12:59:29 +01002741 * \note This was previously known as MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT.
2742 * That name is deprecated, but may still be used as an alternative form for this
2743 * option.
2744 *
Dave Rodgman5b89c552023-10-10 14:59:02 +01002745 * \warning MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT cannot be defined at the
2746 * same time as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY.
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002747 *
2748 * Requires: MBEDTLS_SHA256_C.
2749 *
2750 * Module: library/sha256.c
2751 *
Dave Rodgmanf097bef2023-10-10 14:56:35 +01002752 * Uncomment to have the library check for the Armv8-A SHA-256 crypto extensions
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002753 * and use them if available.
2754 */
Dave Rodgman5b89c552023-10-10 14:59:02 +01002755//#define MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT
Dave Rodgman94a634d2023-10-10 12:59:29 +01002756
Dave Rodgmand85277c2023-10-13 09:22:54 +01002757/**
2758 * \def MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT
2759 *
Dave Rodgman5b89c552023-10-10 14:59:02 +01002760 * \deprecated This is now known as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT.
Dave Rodgman94a634d2023-10-10 12:59:29 +01002761 * This name is now deprecated, but may still be used as an alternative form for
2762 * this option.
2763 */
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002764//#define MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT
2765
2766/**
Dave Rodgman5b89c552023-10-10 14:59:02 +01002767 * \def MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002768 *
Gilles Peskine9b3278b2022-06-09 19:09:38 +02002769 * Enable acceleration of the SHA-256 and SHA-224 cryptographic hash algorithms
2770 * with the ARMv8 cryptographic extensions, which must be available at runtime
2771 * or else an illegal instruction fault will occur.
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002772 *
2773 * \note This allows builds with a smaller code size than with
Dave Rodgman5b89c552023-10-10 14:59:02 +01002774 * MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002775 *
Jerry Yu8bfa24b2023-05-05 14:35:00 +08002776 * \note Minimum compiler versions for this feature are Clang 4.0,
2777 * armclang 6.6 or GCC 6.0.
2778 *
2779 * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for
2780 * armclang <= 6.9
2781 *
Dave Rodgman94a634d2023-10-10 12:59:29 +01002782 * \note This was previously known as MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY.
Dave Rodgman7821df32023-10-13 09:38:44 +01002783 * That name is deprecated, but may still be used as an alternative form for this
Dave Rodgman94a634d2023-10-10 12:59:29 +01002784 * option.
2785 *
Dave Rodgman5b89c552023-10-10 14:59:02 +01002786 * \warning MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY cannot be defined at the same
2787 * time as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT.
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002788 *
2789 * Requires: MBEDTLS_SHA256_C.
2790 *
2791 * Module: library/sha256.c
2792 *
Dave Rodgmanf097bef2023-10-10 14:56:35 +01002793 * Uncomment to have the library use the Armv8-A SHA-256 crypto extensions
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002794 * unconditionally.
2795 */
Dave Rodgman5b89c552023-10-10 14:59:02 +01002796//#define MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY
Dave Rodgman94a634d2023-10-10 12:59:29 +01002797
Dave Rodgmand85277c2023-10-13 09:22:54 +01002798/**
2799 * \def MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY
2800 *
Dave Rodgman5b89c552023-10-10 14:59:02 +01002801 * \deprecated This is now known as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY.
Dave Rodgman94a634d2023-10-10 12:59:29 +01002802 * This name is now deprecated, but may still be used as an alternative form for
2803 * this option.
2804 */
Tom Cosgrovef3ebd902022-02-20 22:25:31 +00002805//#define MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY
2806
2807/**
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002808 * \def MBEDTLS_SHA384_C
Mateusz Starzyke3c48b42021-04-19 16:46:28 +02002809 *
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002810 * Enable the SHA-384 cryptographic hash algorithm.
Mateusz Starzyke3c48b42021-04-19 16:46:28 +02002811 *
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002812 * Module: library/sha512.c
2813 * Caller: library/md.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002814 * library/psa_crypto_hash.c
2815 * library/ssl_tls.c
2816 * library/ssl*_client.c
2817 * library/ssl*_server.c
Mateusz Starzyke3c48b42021-04-19 16:46:28 +02002818 *
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002819 * Comment to disable SHA-384
Mateusz Starzyke3c48b42021-04-19 16:46:28 +02002820 */
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002821#define MBEDTLS_SHA384_C
Mateusz Starzyke3c48b42021-04-19 16:46:28 +02002822
2823/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002824 * \def MBEDTLS_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002825 *
Mateusz Starzyk3352a532021-04-06 14:28:22 +02002826 * Enable SHA-512 cryptographic hash algorithms.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002827 *
Simon Butcher2cb47392016-11-04 12:23:11 +00002828 * Module: library/sha512.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02002829 * Caller: library/entropy.c
Simon Butcher2cb47392016-11-04 12:23:11 +00002830 * library/md.c
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +02002831 * library/ssl_tls.c
2832 * library/ssl_cookie.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002833 *
Mateusz Starzyk3352a532021-04-06 14:28:22 +02002834 * This module adds support for SHA-512.
Paul Bakker5121ce52009-01-03 21:22:43 +00002835 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002836#define MBEDTLS_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002837
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002838/**
Pol Henarejos0cd1f1c2022-05-09 01:04:15 +02002839 * \def MBEDTLS_SHA3_C
2840 *
2841 * Enable the SHA3 cryptographic hash algorithm.
2842 *
2843 * Module: library/sha3.c
2844 *
2845 * This module adds support for SHA3.
2846 */
2847#define MBEDTLS_SHA3_C
2848
2849/**
Tom Cosgrove87fbfb52022-03-15 10:51:52 +00002850 * \def MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
2851 *
Gilles Peskine9b3278b2022-06-09 19:09:38 +02002852 * Enable acceleration of the SHA-512 and SHA-384 cryptographic hash algorithms
2853 * with the ARMv8 cryptographic extensions if they are available at runtime.
2854 * If not, the library will fall back to the C implementation.
Tom Cosgrove87fbfb52022-03-15 10:51:52 +00002855 *
2856 * \note If MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT is defined when building
2857 * for a non-Aarch64 build it will be silently ignored.
2858 *
Jerry Yu8bfa24b2023-05-05 14:35:00 +08002859 * \note Minimum compiler versions for this feature are Clang 7.0,
2860 * armclang 6.9 or GCC 8.0.
2861 *
2862 * \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for
2863 * armclang 6.9
Tom Cosgrove87fbfb52022-03-15 10:51:52 +00002864 *
2865 * \warning MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT cannot be defined at the
2866 * same time as MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY.
2867 *
2868 * Requires: MBEDTLS_SHA512_C.
2869 *
2870 * Module: library/sha512.c
2871 *
2872 * Uncomment to have the library check for the A64 SHA-512 crypto extensions
2873 * and use them if available.
2874 */
2875//#define MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
2876
2877/**
2878 * \def MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY
2879 *
Gilles Peskine9b3278b2022-06-09 19:09:38 +02002880 * Enable acceleration of the SHA-512 and SHA-384 cryptographic hash algorithms
2881 * with the ARMv8 cryptographic extensions, which must be available at runtime
2882 * or else an illegal instruction fault will occur.
Tom Cosgrove87fbfb52022-03-15 10:51:52 +00002883 *
2884 * \note This allows builds with a smaller code size than with
2885 * MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
2886 *
Jerry Yu8bfa24b2023-05-05 14:35:00 +08002887 * \note Minimum compiler versions for this feature are Clang 7.0,
2888 * armclang 6.9 or GCC 8.0.
2889 *
2890 * \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for
2891 * armclang 6.9
Tom Cosgrove87fbfb52022-03-15 10:51:52 +00002892 *
2893 * \warning MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY cannot be defined at the same
2894 * time as MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT.
2895 *
2896 * Requires: MBEDTLS_SHA512_C.
2897 *
2898 * Module: library/sha512.c
2899 *
2900 * Uncomment to have the library use the A64 SHA-512 crypto extensions
2901 * unconditionally.
2902 */
2903//#define MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY
2904
2905/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002906 * \def MBEDTLS_SSL_CACHE_C
Paul Bakker0a597072012-09-25 21:55:46 +00002907 *
2908 * Enable simple SSL cache implementation.
2909 *
2910 * Module: library/ssl_cache.c
2911 * Caller:
2912 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002913 * Requires: MBEDTLS_SSL_CACHE_C
Paul Bakker0a597072012-09-25 21:55:46 +00002914 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002915#define MBEDTLS_SSL_CACHE_C
Paul Bakker0a597072012-09-25 21:55:46 +00002916
2917/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002918 * \def MBEDTLS_SSL_COOKIE_C
Manuel Pégourié-Gonnarda64acd42014-07-23 18:30:45 +02002919 *
2920 * Enable basic implementation of DTLS cookies for hello verification.
2921 *
2922 * Module: library/ssl_cookie.c
2923 * Caller:
Manuel Pégourié-Gonnarda64acd42014-07-23 18:30:45 +02002924 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002925#define MBEDTLS_SSL_COOKIE_C
Manuel Pégourié-Gonnarda64acd42014-07-23 18:30:45 +02002926
2927/**
Manuel Pégourié-Gonnardfd6d8972015-05-15 12:09:00 +02002928 * \def MBEDTLS_SSL_TICKET_C
2929 *
2930 * Enable an implementation of TLS server-side callbacks for session tickets.
2931 *
2932 * Module: library/ssl_ticket.c
2933 * Caller:
Manuel Pégourié-Gonnard0c0f11f2015-05-20 09:55:50 +02002934 *
Przemek Stekiel52a428b2022-10-10 08:47:13 +02002935 * Requires: (MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO) &&
2936 * (MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C)
Manuel Pégourié-Gonnardfd6d8972015-05-15 12:09:00 +02002937 */
2938#define MBEDTLS_SSL_TICKET_C
2939
2940/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002941 * \def MBEDTLS_SSL_CLI_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002942 *
2943 * Enable the SSL/TLS client code.
2944 *
Ronald Cronde1adee2022-03-07 16:20:30 +01002945 * Module: library/ssl*_client.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002946 * Caller:
2947 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002948 * Requires: MBEDTLS_SSL_TLS_C
Paul Bakker5690efc2011-05-26 13:16:06 +00002949 *
Janos Follath745e5612024-12-02 13:22:34 +00002950 * \warning You must call psa_crypto_init() before doing any TLS operations.
2951 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002952 * This module is required for SSL/TLS client support.
2953 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002954#define MBEDTLS_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002955
Paul Bakker9a736322012-11-14 12:39:52 +00002956/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002957 * \def MBEDTLS_SSL_SRV_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002958 *
2959 * Enable the SSL/TLS server code.
2960 *
Ronald Cronde1adee2022-03-07 16:20:30 +01002961 * Module: library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002962 * Caller:
2963 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002964 * Requires: MBEDTLS_SSL_TLS_C
Paul Bakker5690efc2011-05-26 13:16:06 +00002965 *
Janos Follath745e5612024-12-02 13:22:34 +00002966 * \warning You must call psa_crypto_init() before doing any TLS operations.
2967 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002968 * This module is required for SSL/TLS server support.
2969 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002970#define MBEDTLS_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002971
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002972/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002973 * \def MBEDTLS_SSL_TLS_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002974 *
Paul Bakkere29ab062011-05-18 13:26:54 +00002975 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002976 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002977 * Module: library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +01002978 * Caller: library/ssl*_client.c
2979 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +00002980 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002981 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
2982 * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
Paul Bakker5690efc2011-05-26 13:16:06 +00002983 *
Paul Bakker5121ce52009-01-03 21:22:43 +00002984 * This module is required for SSL/TLS.
2985 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002986#define MBEDTLS_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00002987
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002988/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002989 * \def MBEDTLS_TIMING_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002990 *
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01002991 * Enable the semi-portable timing interface.
2992 *
Simon Butcherd567a232016-03-09 20:19:21 +00002993 * \note The provided implementation only works on POSIX/Unix (including Linux,
2994 * BSD and OS X) and Windows. On other platforms, you can either disable that
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01002995 * module and provide your own implementations of the callbacks needed by
2996 * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide
2997 * your own implementation of the whole module by setting
2998 * \c MBEDTLS_TIMING_ALT in the current file.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00002999 *
Andrzej Kurek57353692022-04-07 08:08:21 -04003000 * \note The timing module will include time.h on suitable platforms
3001 * regardless of the setting of MBEDTLS_HAVE_TIME, unless
3002 * MBEDTLS_TIMING_ALT is used. See timing.c for more information.
3003 *
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00003004 * \note See also our Knowledge Base article about porting to a new
3005 * environment:
Dave Rodgmanb3196842022-10-12 16:47:08 +01003006 * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00003007 *
Paul Bakker5121ce52009-01-03 21:22:43 +00003008 * Module: library/timing.c
Paul Bakkerecd54fb2013-07-03 14:48:29 +02003009 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003010#define MBEDTLS_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00003011
Paul Bakkerf3b86c12011-01-27 15:24:17 +00003012/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003013 * \def MBEDTLS_VERSION_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00003014 *
3015 * Enable run-time version information.
3016 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00003017 * Module: library/version.c
3018 *
3019 * This module provides run-time version information.
3020 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003021#define MBEDTLS_VERSION_C
Paul Bakker0a62cd12011-01-21 11:00:08 +00003022
Paul Bakkerf3b86c12011-01-27 15:24:17 +00003023/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003024 * \def MBEDTLS_X509_USE_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00003025 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02003026 * Enable X.509 core for using certificates.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00003027 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003028 * Module: library/x509.c
Simon Butcher2cb47392016-11-04 12:23:11 +00003029 * Caller: library/x509_crl.c
3030 * library/x509_crt.c
3031 * library/x509_csr.c
Paul Bakker5121ce52009-01-03 21:22:43 +00003032 *
Janos Follath277bba82024-11-19 16:14:00 +00003033 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C
Przemek Stekiel278b6672022-08-03 09:50:38 +02003034 *
Janos Follath277bba82024-11-19 16:14:00 +00003035 * \warning You must call psa_crypto_init() before doing any X.509 operation.
Paul Bakker5690efc2011-05-26 13:16:06 +00003036 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003037 * This module is required for the X.509 parsing modules.
Paul Bakker5121ce52009-01-03 21:22:43 +00003038 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003039#define MBEDTLS_X509_USE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00003040
Paul Bakkerf3b86c12011-01-27 15:24:17 +00003041/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003042 * \def MBEDTLS_X509_CRT_PARSE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00003043 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003044 * Enable X.509 certificate parsing.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00003045 *
Simon Butcher2cb47392016-11-04 12:23:11 +00003046 * Module: library/x509_crt.c
Ronald Cronde1adee2022-03-07 16:20:30 +01003047 * Caller: library/ssl_tls.c
3048 * library/ssl*_client.c
3049 * library/ssl*_server.c
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003050 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003051 * Requires: MBEDTLS_X509_USE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003052 *
3053 * This module is required for X.509 certificate parsing.
3054 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003055#define MBEDTLS_X509_CRT_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003056
3057/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003058 * \def MBEDTLS_X509_CRL_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003059 *
3060 * Enable X.509 CRL parsing.
3061 *
Simon Butcher2cb47392016-11-04 12:23:11 +00003062 * Module: library/x509_crl.c
3063 * Caller: library/x509_crt.c
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003064 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003065 * Requires: MBEDTLS_X509_USE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003066 *
3067 * This module is required for X.509 CRL parsing.
3068 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003069#define MBEDTLS_X509_CRL_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003070
3071/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003072 * \def MBEDTLS_X509_CSR_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003073 *
3074 * Enable X.509 Certificate Signing Request (CSR) parsing.
3075 *
Simon Butcher2cb47392016-11-04 12:23:11 +00003076 * Module: library/x509_csr.c
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003077 * Caller: library/x509_crt_write.c
3078 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003079 * Requires: MBEDTLS_X509_USE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003080 *
3081 * This module is used for reading X.509 certificate request.
3082 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003083#define MBEDTLS_X509_CSR_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003084
3085/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003086 * \def MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003087 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02003088 * Enable X.509 core for creating certificates.
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003089 *
3090 * Module: library/x509_create.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00003091 *
Przemek Stekiel10836a02022-08-19 08:45:34 +02003092 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
Przemek Stekiel278b6672022-08-03 09:50:38 +02003093 *
Janos Follath277bba82024-11-19 16:14:00 +00003094 * \warning You must call psa_crypto_init() before doing any X.509 operation.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00003095 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003096 * This module is the basis for creating X.509 certificates and CSRs.
3097 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003098#define MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003099
3100/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003101 * \def MBEDTLS_X509_CRT_WRITE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003102 *
3103 * Enable creating X.509 certificates.
3104 *
3105 * Module: library/x509_crt_write.c
3106 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003107 * Requires: MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003108 *
3109 * This module is required for X.509 certificate creation.
3110 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003111#define MBEDTLS_X509_CRT_WRITE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003112
3113/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003114 * \def MBEDTLS_X509_CSR_WRITE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003115 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02003116 * Enable creating X.509 Certificate Signing Requests (CSR).
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003117 *
3118 * Module: library/x509_csr_write.c
3119 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003120 * Requires: MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02003121 *
Paul Bakkerbdb912d2012-02-13 23:11:30 +00003122 * This module is required for X.509 certificate request writing.
3123 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003124#define MBEDTLS_X509_CSR_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00003125
Gilles Peskinee820c0a2023-08-03 17:45:20 +02003126/** \} name SECTION: Mbed TLS modules */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00003127
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003128/**
Gilles Peskineba4162a2022-04-11 17:04:38 +02003129 * \name SECTION: General configuration options
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003130 *
Gilles Peskined5793ce2022-04-13 23:05:10 +02003131 * This section contains Mbed TLS build settings that are not associated
3132 * with a particular module.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003133 *
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003134 * \{
3135 */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003136
Gilles Peskinea02c1242022-03-16 17:03:19 +01003137/**
3138 * \def MBEDTLS_CONFIG_FILE
3139 *
3140 * If defined, this is a header which will be included instead of
3141 * `"mbedtls/mbedtls_config.h"`.
3142 * This header file specifies the compile-time configuration of Mbed TLS.
Gilles Peskineefffd642022-04-26 18:13:01 +02003143 * Unlike other configuration options, this one must be defined on the
3144 * compiler command line: a definition in `mbedtls_config.h` would have
3145 * no effect.
Gilles Peskinea02c1242022-03-16 17:03:19 +01003146 *
Gilles Peskine6457ef92022-04-11 16:42:37 +02003147 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
Gilles Peskinea02c1242022-03-16 17:03:19 +01003148 * non-standard feature of the C language, so this feature is only available
Gilles Peskine6457ef92022-04-11 16:42:37 +02003149 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
Gilles Peskinea02c1242022-03-16 17:03:19 +01003150 *
Gilles Peskine58ffcba2022-04-14 12:44:16 +02003151 * The value of this symbol is typically a path in double quotes, either
3152 * absolute or relative to a directory on the include search path.
Gilles Peskinea02c1242022-03-16 17:03:19 +01003153 */
3154//#define MBEDTLS_CONFIG_FILE "mbedtls/mbedtls_config.h"
3155
3156/**
3157 * \def MBEDTLS_USER_CONFIG_FILE
3158 *
3159 * If defined, this is a header which will be included after
3160 * `"mbedtls/mbedtls_config.h"` or #MBEDTLS_CONFIG_FILE.
Gilles Peskinef68f43a2022-04-13 23:22:20 +02003161 * This allows you to modify the default configuration, including the ability
3162 * to undefine options that are enabled by default.
Gilles Peskinea02c1242022-03-16 17:03:19 +01003163 *
Gilles Peskine6457ef92022-04-11 16:42:37 +02003164 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
Gilles Peskinea02c1242022-03-16 17:03:19 +01003165 * non-standard feature of the C language, so this feature is only available
Gilles Peskine6457ef92022-04-11 16:42:37 +02003166 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
Gilles Peskinea02c1242022-03-16 17:03:19 +01003167 *
Gilles Peskine58ffcba2022-04-14 12:44:16 +02003168 * The value of this symbol is typically a path in double quotes, either
3169 * absolute or relative to a directory on the include search path.
Gilles Peskinea02c1242022-03-16 17:03:19 +01003170 */
3171//#define MBEDTLS_USER_CONFIG_FILE "/dev/null"
3172
Gilles Peskinef4c6eb02022-03-16 17:10:48 +01003173/**
Gilles Peskineb1176f22023-02-22 22:07:28 +01003174 * \def MBEDTLS_PSA_CRYPTO_PLATFORM_FILE
3175 *
3176 * If defined, this is a header which will be included instead of
3177 * `"psa/crypto_platform.h"`. This file should declare the same identifiers
3178 * as the one in Mbed TLS, but with definitions adapted to the platform on
3179 * which the library code will run.
3180 *
3181 * \note The required content of this header can vary from one version of
3182 * Mbed TLS to the next. Integrators who provide an alternative file
3183 * should review the changes in the original file whenever they
3184 * upgrade Mbed TLS.
3185 *
3186 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
3187 * non-standard feature of the C language, so this feature is only available
3188 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
3189 *
3190 * The value of this symbol is typically a path in double quotes, either
3191 * absolute or relative to a directory on the include search path.
3192 */
3193//#define MBEDTLS_PSA_CRYPTO_PLATFORM_FILE "psa/crypto_platform_alt.h"
3194
3195/**
3196 * \def MBEDTLS_PSA_CRYPTO_STRUCT_FILE
3197 *
3198 * If defined, this is a header which will be included instead of
3199 * `"psa/crypto_struct.h"`. This file should declare the same identifiers
3200 * as the one in Mbed TLS, but with definitions adapted to the environment
3201 * in which the library code will run. The typical use for this feature
3202 * is to provide alternative type definitions on the client side in
3203 * client-server integrations of PSA crypto, where operation structures
3204 * contain handles instead of cryptographic data.
3205 *
3206 * \note The required content of this header can vary from one version of
3207 * Mbed TLS to the next. Integrators who provide an alternative file
3208 * should review the changes in the original file whenever they
3209 * upgrade Mbed TLS.
3210 *
3211 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
3212 * non-standard feature of the C language, so this feature is only available
3213 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
3214 *
3215 * The value of this symbol is typically a path in double quotes, either
3216 * absolute or relative to a directory on the include search path.
3217 */
3218//#define MBEDTLS_PSA_CRYPTO_STRUCT_FILE "psa/crypto_struct_alt.h"
3219
Gilles Peskineba4162a2022-04-11 17:04:38 +02003220/** \} name SECTION: General configuration options */
3221
3222/**
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003223 * \name SECTION: Module configuration options
3224 *
3225 * This section allows for the setting of module specific sizes and
3226 * configuration options. The default values are already present in the
3227 * relevant header files and should suffice for the regular use cases.
3228 *
3229 * Our advice is to enable options and change their values here
3230 * only if you have a good reason and know the consequences.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003231 * \{
3232 */
Gilles Peskine3f49cc12022-04-13 23:21:16 +02003233/* The Doxygen documentation here is used when a user comments out a
3234 * setting and runs doxygen themselves. On the other hand, when we typeset
3235 * the full documentation including disabled settings, the documentation
3236 * in specific modules' header files is used if present. When editing this
3237 * file, make sure that each option is documented in exactly one place,
3238 * plus optionally a same-line Doxygen comment here if there is a Doxygen
3239 * comment in the specific module. */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003240
Paul Bakker088c5c52014-04-25 11:11:10 +02003241/* MPI / BIGNUM options */
Andrzej Kurek86f30ff2023-02-24 07:44:57 -05003242//#define MBEDTLS_MPI_WINDOW_SIZE 2 /**< Maximum window size used. */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003243//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003244
Paul Bakker088c5c52014-04-25 11:11:10 +02003245/* CTR_DRBG options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003246//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
3247//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
3248//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
3249//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
3250//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003251
Paul Bakker088c5c52014-04-25 11:11:10 +02003252/* HMAC_DRBG options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003253//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
3254//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
3255//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
3256//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003257
Paul Bakker088c5c52014-04-25 11:11:10 +02003258/* ECP options */
Gilles Peskine5752e592021-06-02 13:27:03 +02003259//#define MBEDTLS_ECP_WINDOW_SIZE 4 /**< Maximum window size used */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003260//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
Manuel Pégourié-Gonnard0520b602014-01-30 19:43:46 +01003261
Paul Bakker088c5c52014-04-25 11:11:10 +02003262/* Entropy options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003263//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
3264//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
Andres AG7abc9742016-09-23 17:58:49 +01003265//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
Paul Bakkere1b665e2013-12-11 16:02:58 +01003266
Gilles Peskineed038902020-11-13 21:33:21 +01003267/* PSA options */
Gilles Peskine14c332b2020-11-14 12:26:53 +01003268/**
Gilles Peskineed038902020-11-13 21:33:21 +01003269 * Use HMAC_DRBG with the specified hash algorithm for HMAC_DRBG for the
3270 * PSA crypto subsystem.
3271 *
Gilles Peskine868d2522024-07-01 21:14:45 +02003272 * If this option is unset, the library chooses a hash (currently between
3273 * #MBEDTLS_MD_SHA512 and #MBEDTLS_MD_SHA256) based on availability and
3274 * unspecified heuristics.
3275 *
3276 * \note The PSA crypto subsystem uses the first available mechanism amongst
3277 * the following:
3278 * - #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG if enabled;
3279 * - Entropy from #MBEDTLS_ENTROPY_C plus CTR_DRBG with AES
3280 * if #MBEDTLS_CTR_DRBG_C is enabled;
3281 * - Entropy from #MBEDTLS_ENTROPY_C plus HMAC_DRBG.
3282 *
3283 * A future version may reevaluate the prioritization of DRBG mechanisms.
Gilles Peskineed038902020-11-13 21:33:21 +01003284 */
3285//#define MBEDTLS_PSA_HMAC_DRBG_MD_TYPE MBEDTLS_MD_SHA256
3286
Steven Cooreman863470a2021-02-15 14:03:19 +01003287/** \def MBEDTLS_PSA_KEY_SLOT_COUNT
Steven Cooreman1f968fd2021-02-15 14:00:24 +01003288 *
Gilles Peskine9e9e1f62024-05-31 18:38:36 +02003289 * When #MBEDTLS_PSA_KEY_STORE_DYNAMIC is disabled,
3290 * the maximum amount of PSA keys simultaneously in memory. This counts all
Gilles Peskine2cb03a52024-07-16 21:29:13 +02003291 * volatile keys, plus loaded persistent keys.
3292 *
Gilles Peskine9e9e1f62024-05-31 18:38:36 +02003293 * When #MBEDTLS_PSA_KEY_STORE_DYNAMIC is enabled,
3294 * the maximum number of loaded persistent keys.
3295 *
Gilles Peskine2cb03a52024-07-16 21:29:13 +02003296 * Currently, persistent keys do not need to be loaded all the time while
3297 * a multipart operation is in progress, only while the operation is being
3298 * set up. This may change in future versions of the library.
3299 *
3300 * Currently, the library traverses of the whole table on each access to a
3301 * persistent key. Therefore large values may cause poor performance.
3302 *
3303 * This option has no effect when #MBEDTLS_PSA_CRYPTO_C is disabled.
Steven Cooreman1f968fd2021-02-15 14:00:24 +01003304 */
Steven Cooreman863470a2021-02-15 14:03:19 +01003305//#define MBEDTLS_PSA_KEY_SLOT_COUNT 32
Steven Cooreman1f968fd2021-02-15 14:00:24 +01003306
Valerio Settia7ce5892024-08-13 10:44:02 +02003307/**
Valerio Setti933b7692024-08-13 11:08:26 +02003308 * \def MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
Valerio Settia7ce5892024-08-13 10:44:02 +02003309 *
Valerio Settic2a6e8b2024-08-16 07:58:02 +02003310 * Define the size (in bytes) of each static key buffer when
3311 * #MBEDTLS_PSA_STATIC_KEY_SLOTS is set. If not
3312 * explicitly defined then it's automatically guessed from available PSA keys
3313 * enabled in the build through PSA_WANT_xxx symbols.
Valerio Settia7ce5892024-08-13 10:44:02 +02003314 * If required by the application this parameter can be set to higher values
3315 * in order to store larger objects (ex: raw keys), but please note that this
3316 * will increase RAM usage.
Valerio Settia7ce5892024-08-13 10:44:02 +02003317 */
3318//#define MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE 256
3319
Waleed Elmelegyd7bdbbe2023-07-20 16:26:58 +00003320/* RSA OPTIONS */
Gilles Peskinef9e4caf2023-09-05 21:11:27 +02003321//#define MBEDTLS_RSA_GEN_KEY_MIN_BITS 1024 /**< Minimum RSA key size that can be generated in bits (Minimum possible value is 128 bits) */
Waleed Elmelegyd7bdbbe2023-07-20 16:26:58 +00003322
Paul Bakker088c5c52014-04-25 11:11:10 +02003323/* SSL Cache options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003324//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
3325//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
Paul Bakker6e339b52013-07-03 13:37:05 +02003326
Paul Bakker088c5c52014-04-25 11:11:10 +02003327/* SSL options */
Angus Grattond8213d02016-05-25 20:56:48 +10003328
Angus Grattond8213d02016-05-25 20:56:48 +10003329/** \def MBEDTLS_SSL_IN_CONTENT_LEN
3330 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05003331 * Maximum length (in bytes) of incoming plaintext fragments.
Angus Grattond8213d02016-05-25 20:56:48 +10003332 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05003333 * This determines the size of the incoming TLS I/O buffer in such a way
3334 * that it is capable of holding the specified amount of plaintext data,
3335 * regardless of the protection mechanism used.
3336 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05003337 * \note When using a value less than the default of 16KB on the client, it is
3338 * recommended to use the Maximum Fragment Length (MFL) extension to
3339 * inform the server about this limitation. On the server, there
3340 * is no supported, standardized way of informing the client about
3341 * restriction on the maximum size of incoming messages, and unless
3342 * the limitation has been communicated by other means, it is recommended
3343 * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
3344 * while keeping the default value of 16KB for the incoming buffer.
3345 *
David Horstmann95d516f2021-05-04 18:36:56 +01003346 * Uncomment to set the maximum plaintext size of the incoming I/O buffer.
Angus Grattond8213d02016-05-25 20:56:48 +10003347 */
3348//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
3349
Gilles Peskined3d02902020-03-04 21:35:27 +01003350/** \def MBEDTLS_SSL_CID_IN_LEN_MAX
3351 *
3352 * The maximum length of CIDs used for incoming DTLS messages.
3353 *
3354 */
3355//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32
3356
3357/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX
3358 *
3359 * The maximum length of CIDs used for outgoing DTLS messages.
3360 *
3361 */
3362//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32
3363
TRodziewicze8dd7092021-05-12 14:19:11 +02003364/** \def MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY
Gilles Peskined3d02902020-03-04 21:35:27 +01003365 *
3366 * This option controls the use of record plaintext padding
TRodziewicz1e660ed2021-05-26 17:08:54 +02003367 * in TLS 1.3 and when using the Connection ID extension in DTLS 1.2.
Hanno Becker13996922020-05-28 16:15:19 +01003368 *
3369 * The padding will always be chosen so that the length of the
3370 * padded plaintext is a multiple of the value of this option.
3371 *
3372 * Note: A value of \c 1 means that no padding will be used
3373 * for outgoing records.
3374 *
3375 * Note: On systems lacking division instructions,
3376 * a power of two should be preferred.
3377 */
TRodziewicze8dd7092021-05-12 14:19:11 +02003378//#define MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 16
Hanno Becker13996922020-05-28 16:15:19 +01003379
Angus Grattond8213d02016-05-25 20:56:48 +10003380/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
3381 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05003382 * Maximum length (in bytes) of outgoing plaintext fragments.
Angus Grattond8213d02016-05-25 20:56:48 +10003383 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05003384 * This determines the size of the outgoing TLS I/O buffer in such a way
3385 * that it is capable of holding the specified amount of plaintext data,
3386 * regardless of the protection mechanism used.
3387 *
Angus Grattond8213d02016-05-25 20:56:48 +10003388 * It is possible to save RAM by setting a smaller outward buffer, while keeping
3389 * the default inward 16384 byte buffer to conform to the TLS specification.
3390 *
3391 * The minimum required outward buffer size is determined by the handshake
3392 * protocol's usage. Handshaking will fail if the outward buffer is too small.
3393 * The specific size requirement depends on the configured ciphers and any
3394 * certificate data which is sent during the handshake.
3395 *
David Horstmann95d516f2021-05-04 18:36:56 +01003396 * Uncomment to set the maximum plaintext size of the outgoing I/O buffer.
Angus Grattond8213d02016-05-25 20:56:48 +10003397 */
3398//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
3399
Hanno Beckere0b150f2018-08-21 15:51:03 +01003400/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
3401 *
3402 * Maximum number of heap-allocated bytes for the purpose of
3403 * DTLS handshake message reassembly and future message buffering.
3404 *
Yuto Takano7828ca22021-08-10 11:26:15 +01003405 * This should be at least 9/8 * MBEDTLS_SSL_IN_CONTENT_LEN
Hanno Becker28007512018-08-28 09:46:44 +01003406 * to account for a reassembled handshake message of maximum size,
3407 * together with its reassembly bitmap.
3408 *
Hanno Becker97a1c132018-08-28 14:42:15 +01003409 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
Hanno Becker28007512018-08-28 09:46:44 +01003410 * should be sufficient for all practical situations as it allows
3411 * to reassembly a large handshake message (such as a certificate)
3412 * while buffering multiple smaller handshake messages.
3413 *
Hanno Beckere0b150f2018-08-21 15:51:03 +01003414 */
Hanno Becker159a37f2018-08-24 15:07:29 +01003415//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
Hanno Beckere0b150f2018-08-21 15:51:03 +01003416
Ronald Cron1aa6e8d2023-02-23 09:46:54 +01003417//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 or 384 bits) */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003418//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02003419
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02003420/**
3421 * Complete list of ciphersuites to use, in order of preference.
3422 *
3423 * \warning No dependency checking is done on that field! This option can only
3424 * be used to restrict the set of available ciphersuites. It is your
3425 * responsibility to make sure the needed modules are active.
3426 *
3427 * Use this to save a few hundred bytes of ROM (default ordering of all
3428 * available ciphersuites) and a few to a few hundred bytes of RAM.
3429 *
3430 * The value below is only an example, not the default.
3431 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003432//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02003433
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003434/**
Tom Cosgrovea63775b2023-09-14 13:31:19 +01003435 * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE
3436 *
3437 * The default maximum amount of 0-RTT data. See the documentation of
Yanray Wang07517612023-11-07 11:47:36 +08003438 * \c mbedtls_ssl_conf_max_early_data_size() for more information.
Tom Cosgrovea63775b2023-09-14 13:31:19 +01003439 *
3440 * It must be positive and smaller than UINT32_MAX.
3441 *
3442 * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not
3443 * have any impact on the build.
Tom Cosgrovea63775b2023-09-14 13:31:19 +01003444 */
3445//#define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1024
3446
3447/**
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003448 * \def MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE
3449 *
Jerry Yucf913512023-11-14 11:06:52 +08003450 * Maximum allowed ticket age difference in milliseconds tolerated between
Jerry Yu034a8b72023-11-10 12:20:19 +08003451 * server and client. Default value is 6000. This is not used in TLS 1.2.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003452 *
Jerry Yu034a8b72023-11-10 12:20:19 +08003453 * - The client ticket age is the time difference between the time when the
3454 * client proposes to the server to use the ticket and the time the client
3455 * received the ticket from the server.
3456 * - The server ticket age is the time difference between the time when the
3457 * server receives a proposition from the client to use the ticket and the
3458 * time when the ticket was created by the server.
3459 *
Jerry Yucf913512023-11-14 11:06:52 +08003460 * The ages might be different due to the client and server clocks not running
3461 * at the same pace. The typical accuracy of an RTC crystal is ±100 to ±20 parts
3462 * per million (360 to 72 milliseconds per hour). Default tolerance window is
3463 * 6s, thus in the worst case clients and servers must sync up their system time
3464 * every 6000/360/2~=8 hours.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003465 *
Jerry Yu04fceb72023-11-15 09:52:46 +08003466 * See section 8.3 of the TLS 1.3 specification(RFC 8446) for more information.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003467 */
Gilles Peskined65ea422023-09-05 21:07:32 +02003468//#define MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 6000
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003469
3470/**
3471 * \def MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH
3472 *
3473 * Size in bytes of a ticket nonce. This is not used in TLS 1.2.
3474 *
3475 * This must be less than 256.
3476 */
Gilles Peskined65ea422023-09-05 21:07:32 +02003477//#define MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH 32
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003478
3479/**
3480 * \def MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS
3481 *
3482 * Default number of NewSessionTicket messages to be sent by a TLS 1.3 server
3483 * after handshake completion. This is not used in TLS 1.2 and relevant only if
3484 * the MBEDTLS_SSL_SESSION_TICKETS option is enabled.
3485 *
3486 */
Gilles Peskined65ea422023-09-05 21:07:32 +02003487//#define MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1
Gilles Peskinea8d7e432022-08-04 23:39:41 +02003488
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01003489/* X509 options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02003490//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
Andres AGf9113192016-09-02 14:06:04 +01003491//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01003492
Gilles Peskine611179c2022-04-13 23:04:48 +02003493/** \} name SECTION: Module configuration options */