1 /**
2  * \file mbedtls_config.h
3  *
4  * \brief Configuration options (set of defines)
5  *
6  *  This set of compile-time options may be used to enable
7  *  or disable features selectively, and reduce the global
8  *  memory footprint.
9  */
10 /*
11  *  Copyright The Mbed TLS Contributors
12  *  SPDX-License-Identifier: Apache-2.0
13  *
14  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
15  *  not use this file except in compliance with the License.
16  *  You may obtain a copy of the License at
17  *
18  *  http://www.apache.org/licenses/LICENSE-2.0
19  *
20  *  Unless required by applicable law or agreed to in writing, software
21  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  *  See the License for the specific language governing permissions and
24  *  limitations under the License.
25  */
26 
27 #include <rom/ets_sys.h>
28 
29 /**
30  * This is an optional version symbol that enables comatibility handling of
31  * config files.
32  *
33  * It is equal to the #MBEDTLS_VERSION_NUMBER of the Mbed TLS version that
34  * introduced the config format we want to be compatible with.
35  */
36 //#define MBEDTLS_CONFIG_VERSION 0x03000000
37 
38 /**
39  * \name SECTION: System support
40  *
41  * This section sets system specific settings.
42  * \{
43  */
44 
45 /**
46  * \def MBEDTLS_HAVE_ASM
47  *
48  * The compiler has support for asm().
49  *
50  * Requires support for asm() in compiler.
51  *
52  * Used in:
53  *      library/aria.c
54  *      library/bn_mul.h
55  *
56  * Required by:
57  *      MBEDTLS_AESNI_C
58  *      MBEDTLS_PADLOCK_C
59  *
60  * Comment to disable the use of assembly code.
61  */
62 #define MBEDTLS_HAVE_ASM
63 
64 /**
65  * \def MBEDTLS_NO_UDBL_DIVISION
66  *
67  * The platform lacks support for double-width integer division (64-bit
68  * division on a 32-bit platform, 128-bit division on a 64-bit platform).
69  *
70  * Used in:
71  *      include/mbedtls/bignum.h
72  *      library/bignum.c
73  *
74  * The bignum code uses double-width division to speed up some operations.
75  * Double-width division is often implemented in software that needs to
76  * be linked with the program. The presence of a double-width integer
77  * type is usually detected automatically through preprocessor macros,
78  * but the automatic detection cannot know whether the code needs to
79  * and can be linked with an implementation of division for that type.
80  * By default division is assumed to be usable if the type is present.
81  * Uncomment this option to prevent the use of double-width division.
82  *
83  * Note that division for the native integer type is always required.
84  * Furthermore, a 64-bit type is always required even on a 32-bit
85  * platform, but it need not support multiplication or division. In some
86  * cases it is also desirable to disable some double-width operations. For
87  * example, if double-width division is implemented in software, disabling
88  * it can reduce code size in some embedded targets.
89  */
90 //#define MBEDTLS_NO_UDBL_DIVISION
91 
92 /**
93  * \def MBEDTLS_NO_64BIT_MULTIPLICATION
94  *
95  * The platform lacks support for 32x32 -> 64-bit multiplication.
96  *
97  * Used in:
98  *      library/poly1305.c
99  *
100  * Some parts of the library may use multiplication of two unsigned 32-bit
101  * operands with a 64-bit result in order to speed up computations. On some
102  * platforms, this is not available in hardware and has to be implemented in
103  * software, usually in a library provided by the toolchain.
104  *
105  * Sometimes it is not desirable to have to link to that library. This option
106  * removes the dependency of that library on platforms that lack a hardware
107  * 64-bit multiplier by embedding a software implementation in Mbed TLS.
108  *
109  * Note that depending on the compiler, this may decrease performance compared
110  * to using the library function provided by the toolchain.
111  */
112 //#define MBEDTLS_NO_64BIT_MULTIPLICATION
113 
114 /**
115  * \def MBEDTLS_HAVE_SSE2
116  *
117  * CPU supports SSE2 instruction set.
118  *
119  * Uncomment if the CPU supports SSE2 (IA-32 specific).
120  */
121 //#define MBEDTLS_HAVE_SSE2
122 
123 /**
124  * \def MBEDTLS_HAVE_TIME
125  *
126  * System has time.h and time().
127  * The time does not need to be correct, only time differences are used,
128  * by contrast with MBEDTLS_HAVE_TIME_DATE
129  *
130  * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT,
131  * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and
132  * MBEDTLS_PLATFORM_STD_TIME.
133  *
134  * Comment if your system does not support time functions
135  */
136 #define MBEDTLS_HAVE_TIME
137 
138 /**
139  * \def MBEDTLS_HAVE_TIME_DATE
140  *
141  * System has time.h, time(), and an implementation for
142  * mbedtls_platform_gmtime_r() (see below).
143  * The time needs to be correct (not necessarily very accurate, but at least
144  * the date should be correct). This is used to verify the validity period of
145  * X.509 certificates.
146  *
147  * Comment if your system does not have a correct clock.
148  *
149  * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that
150  * behaves similarly to the gmtime_r() function from the C standard. Refer to
151  * the documentation for mbedtls_platform_gmtime_r() for more information.
152  *
153  * \note It is possible to configure an implementation for
154  * mbedtls_platform_gmtime_r() at compile-time by using the macro
155  * MBEDTLS_PLATFORM_GMTIME_R_ALT.
156  */
157 #define MBEDTLS_HAVE_TIME_DATE
158 
159 /**
160  * \def MBEDTLS_PLATFORM_MEMORY
161  *
162  * Enable the memory allocation layer.
163  *
164  * By default mbed TLS uses the system-provided calloc() and free().
165  * This allows different allocators (self-implemented or provided) to be
166  * provided to the platform abstraction layer.
167  *
168  * Enabling MBEDTLS_PLATFORM_MEMORY without the
169  * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
170  * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
171  * free() function pointer at runtime.
172  *
173  * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
174  * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
175  * alternate function at compile time.
176  *
177  * Requires: MBEDTLS_PLATFORM_C
178  *
179  * Enable this layer to allow use of alternative memory allocators.
180  */
181 #define MBEDTLS_PLATFORM_MEMORY
182 
183 /**
184  * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
185  *
186  * Do not assign standard functions in the platform layer (e.g. calloc() to
187  * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
188  *
189  * This makes sure there are no linking errors on platforms that do not support
190  * these functions. You will HAVE to provide alternatives, either at runtime
191  * via the platform_set_xxx() functions or at compile time by setting
192  * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
193  * MBEDTLS_PLATFORM_XXX_MACRO.
194  *
195  * Requires: MBEDTLS_PLATFORM_C
196  *
197  * Uncomment to prevent default assignment of standard functions in the
198  * platform layer.
199  */
200 #define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
201 
202 /**
203  * \def MBEDTLS_PLATFORM_EXIT_ALT
204  *
205  * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the
206  * function in the platform abstraction layer.
207  *
208  * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will
209  * provide a function "mbedtls_platform_set_printf()" that allows you to set an
210  * alternative printf function pointer.
211  *
212  * All these define require MBEDTLS_PLATFORM_C to be defined!
213  *
214  * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
215  * it will be enabled automatically by check_config.h
216  *
217  * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
218  * MBEDTLS_PLATFORM_XXX_MACRO!
219  *
220  * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME
221  *
222  * Uncomment a macro to enable alternate implementation of specific base
223  * platform function
224  */
225 #define MBEDTLS_PLATFORM_EXIT_ALT
226 //#define MBEDTLS_PLATFORM_TIME_ALT
227 //#define MBEDTLS_PLATFORM_FPRINTF_ALT
228 //#define MBEDTLS_PLATFORM_PRINTF_ALT
229 //#define MBEDTLS_PLATFORM_SNPRINTF_ALT
230 //#define MBEDTLS_PLATFORM_VSNPRINTF_ALT
231 //#define MBEDTLS_PLATFORM_NV_SEED_ALT
232 //#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
233 
234 /**
235  * \def MBEDTLS_DEPRECATED_WARNING
236  *
237  * Mark deprecated functions and features so that they generate a warning if
238  * used. Functionality deprecated in one version will usually be removed in the
239  * next version. You can enable this to help you prepare the transition to a
240  * new major version by making sure your code is not using this functionality.
241  *
242  * This only works with GCC and Clang. With other compilers, you may want to
243  * use MBEDTLS_DEPRECATED_REMOVED
244  *
245  * Uncomment to get warnings on using deprecated functions and features.
246  */
247 //#define MBEDTLS_DEPRECATED_WARNING
248 
249 /**
250  * \def MBEDTLS_DEPRECATED_REMOVED
251  *
252  * Remove deprecated functions and features so that they generate an error if
253  * used. Functionality deprecated in one version will usually be removed in the
254  * next version. You can enable this to help you prepare the transition to a
255  * new major version by making sure your code is not using this functionality.
256  *
257  * Uncomment to get errors on using deprecated functions and features.
258  */
259 //#define MBEDTLS_DEPRECATED_REMOVED
260 
261 /* \} name SECTION: System support */
262 
263 /**
264  * \name SECTION: mbed TLS feature support
265  *
266  * This section sets support for features that are or are not needed
267  * within the modules that are enabled.
268  * \{
269  */
270 
271 /**
272  * \def MBEDTLS_TIMING_ALT
273  *
274  * Uncomment to provide your own alternate implementation for
275  * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay()
276  *
277  * Only works if you have MBEDTLS_TIMING_C enabled.
278  *
279  * You will need to provide a header "timing_alt.h" and an implementation at
280  * compile time.
281  */
282 //#define MBEDTLS_TIMING_ALT
283 
284 /**
285  * \def MBEDTLS_AES_ALT
286  *
287  * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
288  * alternate core implementation of a symmetric crypto, an arithmetic or hash
289  * module (e.g. platform specific assembly optimized implementations). Keep
290  * in mind that the function prototypes should remain the same.
291  *
292  * This replaces the whole module. If you only want to replace one of the
293  * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
294  *
295  * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
296  * provide the "struct mbedtls_aes_context" definition and omit the base
297  * function declarations and implementations. "aes_alt.h" will be included from
298  * "aes.h" to include the new function definitions.
299  *
300  * Uncomment a macro to enable alternate implementation of the corresponding
301  * module.
302  *
303  * \warning   MD5, DES and SHA-1 are considered weak and their
304  *            use constitutes a security risk. If possible, we recommend
305  *            avoiding dependencies on them, and considering stronger message
306  *            digests and ciphers instead.
307  *
308  */
309 //#define MBEDTLS_AES_ALT
310 //#define MBEDTLS_ARIA_ALT
311 //#define MBEDTLS_CAMELLIA_ALT
312 //#define MBEDTLS_CCM_ALT
313 //#define MBEDTLS_CHACHA20_ALT
314 //#define MBEDTLS_CHACHAPOLY_ALT
315 //#define MBEDTLS_CMAC_ALT
316 //#define MBEDTLS_DES_ALT
317 //#define MBEDTLS_DHM_ALT
318 //#define MBEDTLS_ECJPAKE_ALT
319 //#define MBEDTLS_GCM_ALT
320 //#define MBEDTLS_NIST_KW_ALT
321 //#define MBEDTLS_MD5_ALT
322 //#define MBEDTLS_POLY1305_ALT
323 //#define MBEDTLS_RIPEMD160_ALT
324 //#define MBEDTLS_RSA_ALT
325 //#define MBEDTLS_SHA1_ALT
326 //#define MBEDTLS_SHA256_ALT
327 //#define MBEDTLS_SHA512_ALT
328 
329 /*
330  * When replacing the elliptic curve module, pleace consider, that it is
331  * implemented with two .c files:
332  *      - ecp.c
333  *      - ecp_curves.c
334  * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT
335  * macros as described above. The only difference is that you have to make sure
336  * that you provide functionality for both .c files.
337  */
338 //#define MBEDTLS_ECP_ALT
339 
340 /**
341  * \def MBEDTLS_SHA256_PROCESS_ALT
342  *
343  * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you
344  * alternate core implementation of symmetric crypto or hash function. Keep in
345  * mind that function prototypes should remain the same.
346  *
347  * This replaces only one function. The header file from mbed TLS is still
348  * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags.
349  *
350  * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will
351  * no longer provide the mbedtls_sha1_process() function, but it will still provide
352  * the other function (using your mbedtls_sha1_process() function) and the definition
353  * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible
354  * with this definition.
355  *
356  * \note If you use the AES_xxx_ALT macros, then it is recommended to also set
357  *       MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
358  *       tables.
359  *
360  * Uncomment a macro to enable alternate implementation of the corresponding
361  * function.
362  *
363  * \warning   MD5, DES and SHA-1 are considered weak and their use
364  *            constitutes a security risk. If possible, we recommend avoiding
365  *            dependencies on them, and considering stronger message digests
366  *            and ciphers instead.
367  *
368  * \warning   If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC are
369  *            enabled, then the deterministic ECDH signature functions pass the
370  *            the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). Therefore
371  *            alternative implementations should use the RNG only for generating
372  *            the ephemeral key and nothing else. If this is not possible, then
373  *            MBEDTLS_ECDSA_DETERMINISTIC should be disabled and an alternative
374  *            implementation should be provided for mbedtls_ecdsa_sign_det_ext().
375  *
376  */
377 //#define MBEDTLS_MD5_PROCESS_ALT
378 //#define MBEDTLS_RIPEMD160_PROCESS_ALT
379 //#define MBEDTLS_SHA1_PROCESS_ALT
380 //#define MBEDTLS_SHA256_PROCESS_ALT
381 //#define MBEDTLS_SHA512_PROCESS_ALT
382 //#define MBEDTLS_DES_SETKEY_ALT
383 //#define MBEDTLS_DES_CRYPT_ECB_ALT
384 //#define MBEDTLS_DES3_CRYPT_ECB_ALT
385 //#define MBEDTLS_AES_SETKEY_ENC_ALT
386 //#define MBEDTLS_AES_SETKEY_DEC_ALT
387 //#define MBEDTLS_AES_ENCRYPT_ALT
388 //#define MBEDTLS_AES_DECRYPT_ALT
389 //#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
390 //#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT
391 //#define MBEDTLS_ECDSA_VERIFY_ALT
392 //#define MBEDTLS_ECDSA_SIGN_ALT
393 //#define MBEDTLS_ECDSA_GENKEY_ALT
394 
395 /**
396  * \def MBEDTLS_ECP_INTERNAL_ALT
397  *
398  * Expose a part of the internal interface of the Elliptic Curve Point module.
399  *
400  * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your
401  * alternative core implementation of elliptic curve arithmetic. Keep in mind
402  * that function prototypes should remain the same.
403  *
404  * This partially replaces one function. The header file from mbed TLS is still
405  * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation
406  * is still present and it is used for group structures not supported by the
407  * alternative.
408  *
409  * The original implementation can in addition be removed by setting the
410  * MBEDTLS_ECP_NO_FALLBACK option, in which case any function for which the
411  * corresponding MBEDTLS_ECP__FUNCTION_NAME__ALT macro is defined will not be
412  * able to fallback to curves not supported by the alternative implementation.
413  *
414  * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT
415  * and implementing the following functions:
416  *      unsigned char mbedtls_internal_ecp_grp_capable(
417  *          const mbedtls_ecp_group *grp )
418  *      int  mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp )
419  *      void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp )
420  * The mbedtls_internal_ecp_grp_capable function should return 1 if the
421  * replacement functions implement arithmetic for the given group and 0
422  * otherwise.
423  * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_free are
424  * called before and after each point operation and provide an opportunity to
425  * implement optimized set up and tear down instructions.
426  *
427  * Example: In case you set MBEDTLS_ECP_INTERNAL_ALT and
428  * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac()
429  * function, but will use your mbedtls_internal_ecp_double_jac() if the group
430  * for the operation is supported by your implementation (i.e. your
431  * mbedtls_internal_ecp_grp_capable() function returns 1 for this group). If the
432  * group is not supported by your implementation, then the original mbed TLS
433  * implementation of ecp_double_jac() is used instead, unless this fallback
434  * behaviour is disabled by setting MBEDTLS_ECP_NO_FALLBACK (in which case
435  * ecp_double_jac() will return MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE).
436  *
437  * The function prototypes and the definition of mbedtls_ecp_group and
438  * mbedtls_ecp_point will not change based on MBEDTLS_ECP_INTERNAL_ALT, so your
439  * implementation of mbedtls_internal_ecp__function_name__ must be compatible
440  * with their definitions.
441  *
442  * Uncomment a macro to enable alternate implementation of the corresponding
443  * function.
444  */
445 /* Required for all the functions in this section */
446 //#define MBEDTLS_ECP_INTERNAL_ALT
447 /* Turn off software fallback for curves not supported in hardware */
448 //#define MBEDTLS_ECP_NO_FALLBACK
449 /* Support for Weierstrass curves with Jacobi representation */
450 //#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
451 //#define MBEDTLS_ECP_ADD_MIXED_ALT
452 //#define MBEDTLS_ECP_DOUBLE_JAC_ALT
453 //#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
454 //#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
455 /* Support for curves with Montgomery arithmetic */
456 //#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
457 //#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
458 //#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
459 
460 /**
461  * \def MBEDTLS_ENTROPY_HARDWARE_ALT
462  *
463  * Uncomment this macro to let mbed TLS use your own implementation of a
464  * hardware entropy collector.
465  *
466  * Your function must be called \c mbedtls_hardware_poll(), have the same
467  * prototype as declared in library/entropy_poll.h, and accept NULL as first
468  * argument.
469  *
470  * Uncomment to use your own hardware entropy collector.
471  */
472 //#define MBEDTLS_ENTROPY_HARDWARE_ALT
473 
474 /**
475  * \def MBEDTLS_AES_ROM_TABLES
476  *
477  * Use precomputed AES tables stored in ROM.
478  *
479  * Uncomment this macro to use precomputed AES tables stored in ROM.
480  * Comment this macro to generate AES tables in RAM at runtime.
481  *
482  * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
483  * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
484  * initialization time before the first AES operation can be performed.
485  * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
486  * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
487  * performance if ROM access is slower than RAM access.
488  *
489  * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
490  *
491  */
492 //#define MBEDTLS_AES_ROM_TABLES
493 
494 /**
495  * \def MBEDTLS_AES_FEWER_TABLES
496  *
497  * Use less ROM/RAM for AES tables.
498  *
499  * Uncommenting this macro omits 75% of the AES tables from
500  * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
501  * by computing their values on the fly during operations
502  * (the tables are entry-wise rotations of one another).
503  *
504  * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
505  * by ~6kb but at the cost of more arithmetic operations during
506  * runtime. Specifically, one has to compare 4 accesses within
507  * different tables to 4 accesses with additional arithmetic
508  * operations within the same table. The performance gain/loss
509  * depends on the system and memory details.
510  *
511  * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
512  *
513  */
514 //#define MBEDTLS_AES_FEWER_TABLES
515 
516 /**
517  * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
518  *
519  * Use less ROM for the Camellia implementation (saves about 768 bytes).
520  *
521  * Uncomment this macro to use less memory for Camellia.
522  */
523 //#define MBEDTLS_CAMELLIA_SMALL_MEMORY
524 
525 /**
526  * \def MBEDTLS_CIPHER_MODE_CBC
527  *
528  * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
529  */
530 #define MBEDTLS_CIPHER_MODE_CBC
531 
532 /**
533  * \def MBEDTLS_CIPHER_MODE_CFB
534  *
535  * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
536  */
537 #define MBEDTLS_CIPHER_MODE_CFB
538 
539 /**
540  * \def MBEDTLS_CIPHER_MODE_CTR
541  *
542  * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
543  */
544 #define MBEDTLS_CIPHER_MODE_CTR
545 
546 /**
547  * \def MBEDTLS_CIPHER_MODE_OFB
548  *
549  * Enable Output Feedback mode (OFB) for symmetric ciphers.
550  */
551 #define MBEDTLS_CIPHER_MODE_OFB
552 
553 /**
554  * \def MBEDTLS_CIPHER_MODE_XTS
555  *
556  * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES.
557  */
558 #define MBEDTLS_CIPHER_MODE_XTS
559 
560 /**
561  * \def MBEDTLS_CIPHER_NULL_CIPHER
562  *
563  * Enable NULL cipher.
564  * Warning: Only do so when you know what you are doing. This allows for
565  * encryption or channels without any security!
566  *
567  * To enable the following ciphersuites:
568  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
569  *      MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
570  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
571  *      MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
572  *      MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
573  *      MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
574  *      MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
575  *      MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
576  *      MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
577  *      MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
578  *      MBEDTLS_TLS_RSA_WITH_NULL_SHA256
579  *      MBEDTLS_TLS_RSA_WITH_NULL_SHA
580  *      MBEDTLS_TLS_RSA_WITH_NULL_MD5
581  *      MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384
582  *      MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256
583  *      MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA
584  *      MBEDTLS_TLS_PSK_WITH_NULL_SHA384
585  *      MBEDTLS_TLS_PSK_WITH_NULL_SHA256
586  *      MBEDTLS_TLS_PSK_WITH_NULL_SHA
587  *
588  * Uncomment this macro to enable the NULL cipher and ciphersuites
589  */
590 //#define MBEDTLS_CIPHER_NULL_CIPHER
591 
592 /**
593  * \def MBEDTLS_CIPHER_PADDING_PKCS7
594  *
595  * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
596  * specific padding modes in the cipher layer with cipher modes that support
597  * padding (e.g. CBC)
598  *
599  * If you disable all padding modes, only full blocks can be used with CBC.
600  *
601  * Enable padding modes in the cipher layer.
602  */
603 #define MBEDTLS_CIPHER_PADDING_PKCS7
604 #define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
605 #define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
606 #define MBEDTLS_CIPHER_PADDING_ZEROS
607 
608 /** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
609  *
610  * Uncomment this macro to use a 128-bit key in the CTR_DRBG module.
611  * By default, CTR_DRBG uses a 256-bit key.
612  */
613 //#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
614 
615 /**
616  * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
617  *
618  * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
619  * module.  By default all supported curves are enabled.
620  *
621  * Comment macros to disable the curve and functions for it
622  */
623 /* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */
624 #define MBEDTLS_ECP_DP_SECP192R1_ENABLED
625 #define MBEDTLS_ECP_DP_SECP224R1_ENABLED
626 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
627 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
628 #define MBEDTLS_ECP_DP_SECP521R1_ENABLED
629 #define MBEDTLS_ECP_DP_SECP192K1_ENABLED
630 #define MBEDTLS_ECP_DP_SECP224K1_ENABLED
631 #define MBEDTLS_ECP_DP_SECP256K1_ENABLED
632 #define MBEDTLS_ECP_DP_BP256R1_ENABLED
633 #define MBEDTLS_ECP_DP_BP384R1_ENABLED
634 #define MBEDTLS_ECP_DP_BP512R1_ENABLED
635 /* Montgomery curves (supporting ECP) */
636 #define MBEDTLS_ECP_DP_CURVE25519_ENABLED
637 #define MBEDTLS_ECP_DP_CURVE448_ENABLED
638 
639 /**
640  * \def MBEDTLS_ECP_NIST_OPTIM
641  *
642  * Enable specific 'modulo p' routines for each NIST prime.
643  * Depending on the prime and architecture, makes operations 4 to 8 times
644  * faster on the corresponding curve.
645  *
646  * Comment this macro to disable NIST curves optimisation.
647  */
648 #define MBEDTLS_ECP_NIST_OPTIM
649 
650 /**
651  * \def MBEDTLS_ECP_RESTARTABLE
652  *
653  * Enable "non-blocking" ECC operations that can return early and be resumed.
654  *
655  * This allows various functions to pause by returning
656  * #MBEDTLS_ERR_ECP_IN_PROGRESS (or, for functions in the SSL module,
657  * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) and then be called later again in
658  * order to further progress and eventually complete their operation. This is
659  * controlled through mbedtls_ecp_set_max_ops() which limits the maximum
660  * number of ECC operations a function may perform before pausing; see
661  * mbedtls_ecp_set_max_ops() for more information.
662  *
663  * This is useful in non-threaded environments if you want to avoid blocking
664  * for too long on ECC (and, hence, X.509 or SSL/TLS) operations.
665  *
666  * Uncomment this macro to enable restartable ECC computations.
667  *
668  * \note  This option only works with the default software implementation of
669  *        elliptic curve functionality. It is incompatible with
670  *        MBEDTLS_ECP_ALT, MBEDTLS_ECDH_XXX_ALT, MBEDTLS_ECDSA_XXX_ALT.
671  */
672 //#define MBEDTLS_ECP_RESTARTABLE
673 
674 /**
675  * \def MBEDTLS_ECDSA_DETERMINISTIC
676  *
677  * Enable deterministic ECDSA (RFC 6979).
678  * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
679  * may result in a compromise of the long-term signing key. This is avoided by
680  * the deterministic variant.
681  *
682  * Requires: MBEDTLS_HMAC_DRBG_C, MBEDTLS_ECDSA_C
683  *
684  * Comment this macro to disable deterministic ECDSA.
685  */
686 #define MBEDTLS_ECDSA_DETERMINISTIC
687 
688 /**
689  * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
690  *
691  * Enable the PSK based ciphersuite modes in SSL / TLS.
692  *
693  * This enables the following ciphersuites (if other requisites are
694  * enabled as well):
695  *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
696  *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
697  *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
698  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
699  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
700  *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
701  *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
702  *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
703  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
704  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
705  */
706 #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
707 
708 /**
709  * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
710  *
711  * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
712  *
713  * Requires: MBEDTLS_DHM_C
714  *
715  * This enables the following ciphersuites (if other requisites are
716  * enabled as well):
717  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
718  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
719  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
720  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
721  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
722  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
723  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
724  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
725  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
726  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
727  *
728  * \warning    Using DHE constitutes a security risk as it
729  *             is not possible to validate custom DH parameters.
730  *             If possible, it is recommended users should consider
731  *             preferring other methods of key exchange.
732  *             See dhm.h for more details.
733  *
734  */
735 #define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
736 
737 /**
738  * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
739  *
740  * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
741  *
742  * Requires: MBEDTLS_ECDH_C
743  *
744  * This enables the following ciphersuites (if other requisites are
745  * enabled as well):
746  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
747  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
748  *      MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
749  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
750  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
751  *      MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
752  */
753 #define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
754 
755 /**
756  * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
757  *
758  * Enable the RSA-PSK based ciphersuite modes in SSL / TLS.
759  *
760  * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
761  *           MBEDTLS_X509_CRT_PARSE_C
762  *
763  * This enables the following ciphersuites (if other requisites are
764  * enabled as well):
765  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
766  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
767  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
768  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
769  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
770  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
771  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
772  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
773  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
774  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
775  */
776 #define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
777 
778 /**
779  * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
780  *
781  * Enable the RSA-only based ciphersuite modes in SSL / TLS.
782  *
783  * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
784  *           MBEDTLS_X509_CRT_PARSE_C
785  *
786  * This enables the following ciphersuites (if other requisites are
787  * enabled as well):
788  *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
789  *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
790  *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
791  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
792  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
793  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
794  *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
795  *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
796  *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
797  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
798  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
799  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
800  */
801 #define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
802 
803 /**
804  * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
805  *
806  * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
807  *
808  * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
809  *           MBEDTLS_X509_CRT_PARSE_C
810  *
811  * This enables the following ciphersuites (if other requisites are
812  * enabled as well):
813  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
814  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
815  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
816  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
817  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
818  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
819  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
820  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
821  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
822  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
823  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
824  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
825  *
826  * \warning    Using DHE constitutes a security risk as it
827  *             is not possible to validate custom DH parameters.
828  *             If possible, it is recommended users should consider
829  *             preferring other methods of key exchange.
830  *             See dhm.h for more details.
831  *
832  */
833 #define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
834 
835 /**
836  * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
837  *
838  * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
839  *
840  * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
841  *           MBEDTLS_X509_CRT_PARSE_C
842  *
843  * This enables the following ciphersuites (if other requisites are
844  * enabled as well):
845  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
846  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
847  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
848  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
849  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
850  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
851  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
852  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
853  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
854  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
855  */
856 #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
857 
858 /**
859  * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
860  *
861  * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
862  *
863  * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C,
864  *
865  * This enables the following ciphersuites (if other requisites are
866  * enabled as well):
867  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
868  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
869  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
870  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
871  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
872  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
873  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
874  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
875  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
876  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
877  */
878 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
879 
880 /**
881  * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
882  *
883  * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
884  *
885  * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C
886  *
887  * This enables the following ciphersuites (if other requisites are
888  * enabled as well):
889  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
890  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
891  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
892  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
893  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
894  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
895  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
896  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
897  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
898  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
899  */
900 #define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
901 
902 /**
903  * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
904  *
905  * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
906  *
907  * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_X509_CRT_PARSE_C
908  *
909  * This enables the following ciphersuites (if other requisites are
910  * enabled as well):
911  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
912  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
913  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
914  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
915  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
916  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
917  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
918  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
919  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
920  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
921  */
922 #define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
923 
924 /**
925  * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
926  *
927  * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
928  *
929  * \warning This is currently experimental. EC J-PAKE support is based on the
930  * Thread v1.0.0 specification; incompatible changes to the specification
931  * might still happen. For this reason, this is disabled by default.
932  *
933  * Requires: MBEDTLS_ECJPAKE_C
934  *           MBEDTLS_SHA256_C
935  *           MBEDTLS_ECP_DP_SECP256R1_ENABLED
936  *
937  * This enables the following ciphersuites (if other requisites are
938  * enabled as well):
939  *      MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
940  */
941 //#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
942 
943 /**
944  * \def MBEDTLS_PK_PARSE_EC_EXTENDED
945  *
946  * Enhance support for reading EC keys using variants of SEC1 not allowed by
947  * RFC 5915 and RFC 5480.
948  *
949  * Currently this means parsing the SpecifiedECDomain choice of EC
950  * parameters (only known groups are supported, not arbitrary domains, to
951  * avoid validation issues).
952  *
953  * Disable if you only need to support RFC 5915 + 5480 key formats.
954  */
955 #define MBEDTLS_PK_PARSE_EC_EXTENDED
956 
957 /**
958  * \def MBEDTLS_ERROR_STRERROR_DUMMY
959  *
960  * Enable a dummy error function to make use of mbedtls_strerror() in
961  * third party libraries easier when MBEDTLS_ERROR_C is disabled
962  * (no effect when MBEDTLS_ERROR_C is enabled).
963  *
964  * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
965  * not using mbedtls_strerror() or error_strerror() in your application.
966  *
967  * Disable if you run into name conflicts and want to really remove the
968  * mbedtls_strerror()
969  */
970 #define MBEDTLS_ERROR_STRERROR_DUMMY
971 
972 /**
973  * \def MBEDTLS_GENPRIME
974  *
975  * Enable the prime-number generation code.
976  *
977  * Requires: MBEDTLS_BIGNUM_C
978  */
979 #define MBEDTLS_GENPRIME
980 
981 /**
982  * \def MBEDTLS_FS_IO
983  *
984  * Enable functions that use the filesystem.
985  */
986 #define MBEDTLS_FS_IO
987 
988 /**
989  * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
990  *
991  * Do not add default entropy sources in mbedtls_entropy_init().
992  *
993  * This is useful to have more control over the added entropy sources in an
994  * application.
995  *
996  * Uncomment this macro to prevent loading of default entropy functions.
997  */
998 //#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
999 
1000 /**
1001  * \def MBEDTLS_NO_PLATFORM_ENTROPY
1002  *
1003  * Do not use built-in platform entropy functions.
1004  * This is useful if your platform does not support
1005  * standards like the /dev/urandom or Windows CryptoAPI.
1006  *
1007  * Uncomment this macro to disable the built-in platform entropy functions.
1008  */
1009 //#define MBEDTLS_NO_PLATFORM_ENTROPY
1010 
1011 /**
1012  * \def MBEDTLS_ENTROPY_FORCE_SHA256
1013  *
1014  * Force the entropy accumulator to use a SHA-256 accumulator instead of the
1015  * default SHA-512 based one (if both are available).
1016  *
1017  * Requires: MBEDTLS_SHA256_C
1018  *
1019  * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
1020  * if you have performance concerns.
1021  *
1022  * This option is only useful if both MBEDTLS_SHA256_C and
1023  * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
1024  */
1025 //#define MBEDTLS_ENTROPY_FORCE_SHA256
1026 
1027 /**
1028  * \def MBEDTLS_ENTROPY_NV_SEED
1029  *
1030  * Enable the non-volatile (NV) seed file-based entropy source.
1031  * (Also enables the NV seed read/write functions in the platform layer)
1032  *
1033  * This is crucial (if not required) on systems that do not have a
1034  * cryptographic entropy source (in hardware or kernel) available.
1035  *
1036  * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
1037  *
1038  * \note The read/write functions that are used by the entropy source are
1039  *       determined in the platform layer, and can be modified at runtime and/or
1040  *       compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
1041  *
1042  * \note If you use the default implementation functions that read a seedfile
1043  *       with regular fopen(), please make sure you make a seedfile with the
1044  *       proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
1045  *       least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
1046  *       and written to or you will get an entropy source error! The default
1047  *       implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
1048  *       bytes from the file.
1049  *
1050  * \note The entropy collector will write to the seed file before entropy is
1051  *       given to an external source, to update it.
1052  */
1053 //#define MBEDTLS_ENTROPY_NV_SEED
1054 
1055 /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
1056  *
1057  * Enable key identifiers that encode a key owner identifier.
1058  *
1059  * The owner of a key is identified by a value of type ::mbedtls_key_owner_id_t
1060  * which is currently hard-coded to be int32_t.
1061  *
1062  * Note that this option is meant for internal use only and may be removed
1063  * without notice. It is incompatible with MBEDTLS_USE_PSA_CRYPTO.
1064  */
1065 //#define MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
1066 
1067 /**
1068  * \def MBEDTLS_MEMORY_DEBUG
1069  *
1070  * Enable debugging of buffer allocator memory issues. Automatically prints
1071  * (to stderr) all (fatal) messages on memory allocation issues. Enables
1072  * function for 'debug output' of allocated memory.
1073  *
1074  * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
1075  *
1076  * Uncomment this macro to let the buffer allocator print out error messages.
1077  */
1078 //#define MBEDTLS_MEMORY_DEBUG
1079 
1080 /**
1081  * \def MBEDTLS_MEMORY_BACKTRACE
1082  *
1083  * Include backtrace information with each allocated block.
1084  *
1085  * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
1086  *           GLIBC-compatible backtrace() an backtrace_symbols() support
1087  *
1088  * Uncomment this macro to include backtrace information
1089  */
1090 //#define MBEDTLS_MEMORY_BACKTRACE
1091 
1092 /**
1093  * \def MBEDTLS_PK_RSA_ALT_SUPPORT
1094  *
1095  * Support external private RSA keys (eg from a HSM) in the PK layer.
1096  *
1097  * Comment this macro to disable support for external private RSA keys.
1098  */
1099 #define MBEDTLS_PK_RSA_ALT_SUPPORT
1100 
1101 /**
1102  * \def MBEDTLS_PKCS1_V15
1103  *
1104  * Enable support for PKCS#1 v1.5 encoding.
1105  *
1106  * Requires: MBEDTLS_RSA_C
1107  *
1108  * This enables support for PKCS#1 v1.5 operations.
1109  */
1110 #define MBEDTLS_PKCS1_V15
1111 
1112 /**
1113  * \def MBEDTLS_PKCS1_V21
1114  *
1115  * Enable support for PKCS#1 v2.1 encoding.
1116  *
1117  * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
1118  *
1119  * This enables support for RSAES-OAEP and RSASSA-PSS operations.
1120  */
1121 #define MBEDTLS_PKCS1_V21
1122 
1123 /** \def MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
1124  *
1125  * Enable support for platform built-in keys. If you enable this feature,
1126  * you must implement the function mbedtls_psa_platform_get_builtin_key().
1127  * See the documentation of that function for more information.
1128  *
1129  * Built-in keys are typically derived from a hardware unique key or
1130  * stored in a secure element.
1131  *
1132  * Requires: MBEDTLS_PSA_CRYPTO_C.
1133  *
1134  * \warning This interface is experimental and may change or be removed
1135  * without notice.
1136  */
1137 //#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
1138 
1139 /** \def MBEDTLS_PSA_CRYPTO_CLIENT
1140  *
1141  * Enable support for PSA crypto client.
1142  *
1143  * \note This option allows to include the code necessary for a PSA
1144  *       crypto client when the PSA crypto implementation is not included in
1145  *       the library (MBEDTLS_PSA_CRYPTO_C disabled). The code included is the
1146  *       code to set and get PSA key attributes.
1147  *       The development of PSA drivers partially relying on the library to
1148  *       fulfill the hardware gaps is another possible usage of this option.
1149  *
1150  * \warning This interface is experimental and may change or be removed
1151  * without notice.
1152  */
1153 //#define MBEDTLS_PSA_CRYPTO_CLIENT
1154 
1155 /** \def MBEDTLS_PSA_CRYPTO_DRIVERS
1156  *
1157  * Enable support for the experimental PSA crypto driver interface.
1158  *
1159  * Requires: MBEDTLS_PSA_CRYPTO_C
1160  *
1161  * \warning This interface is experimental and may change or be removed
1162  * without notice.
1163  */
1164 //#define MBEDTLS_PSA_CRYPTO_DRIVERS
1165 
1166 /** \def MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
1167  *
1168  * Make the PSA Crypto module use an external random generator provided
1169  * by a driver, instead of Mbed TLS's entropy and DRBG modules.
1170  *
1171  * \note This random generator must deliver random numbers with cryptographic
1172  *       quality and high performance. It must supply unpredictable numbers
1173  *       with a uniform distribution. The implementation of this function
1174  *       is responsible for ensuring that the random generator is seeded
1175  *       with sufficient entropy. If you have a hardware TRNG which is slow
1176  *       or delivers non-uniform output, declare it as an entropy source
1177  *       with mbedtls_entropy_add_source() instead of enabling this option.
1178  *
1179  * If you enable this option, you must configure the type
1180  * ::mbedtls_psa_external_random_context_t in psa/crypto_platform.h
1181  * and define a function called mbedtls_psa_external_get_random()
1182  * with the following prototype:
1183  * ```
1184  * psa_status_t mbedtls_psa_external_get_random(
1185  *     mbedtls_psa_external_random_context_t *context,
1186  *     uint8_t *output, size_t output_size, size_t *output_length);
1187  * );
1188  * ```
1189  * The \c context value is initialized to 0 before the first call.
1190  * The function must fill the \c output buffer with \p output_size bytes
1191  * of random data and set \c *output_length to \p output_size.
1192  *
1193  * Requires: MBEDTLS_PSA_CRYPTO_C
1194  *
1195  * \warning If you enable this option, code that uses the PSA cryptography
1196  *          interface will not use any of the entropy sources set up for
1197  *          the entropy module, nor the NV seed that MBEDTLS_ENTROPY_NV_SEED
1198  *          enables.
1199  *
1200  * \note This option is experimental and may be removed without notice.
1201  */
1202 //#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
1203 
1204 /**
1205  * \def MBEDTLS_PSA_CRYPTO_SPM
1206  *
1207  * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure
1208  * Partition Manager) integration which separates the code into two parts: a
1209  * NSPE (Non-Secure Process Environment) and an SPE (Secure Process
1210  * Environment).
1211  *
1212  * Module:  library/psa_crypto.c
1213  * Requires: MBEDTLS_PSA_CRYPTO_C
1214  *
1215  */
1216 //#define MBEDTLS_PSA_CRYPTO_SPM
1217 
1218 /**
1219  * \def MBEDTLS_PSA_INJECT_ENTROPY
1220  *
1221  * Enable support for entropy injection at first boot. This feature is
1222  * required on systems that do not have a built-in entropy source (TRNG).
1223  * This feature is currently not supported on systems that have a built-in
1224  * entropy source.
1225  *
1226  * Requires: MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_ENTROPY_NV_SEED
1227  *
1228  */
1229 //#define MBEDTLS_PSA_INJECT_ENTROPY
1230 
1231 /**
1232  * \def MBEDTLS_RSA_NO_CRT
1233  *
1234  * Do not use the Chinese Remainder Theorem
1235  * for the RSA private operation.
1236  *
1237  * Uncomment this macro to disable the use of CRT in RSA.
1238  *
1239  */
1240 //#define MBEDTLS_RSA_NO_CRT
1241 
1242 /**
1243  * \def MBEDTLS_SELF_TEST
1244  *
1245  * Enable the checkup functions (*_self_test).
1246  */
1247 #define MBEDTLS_SELF_TEST
1248 
1249 /**
1250  * \def MBEDTLS_SHA256_SMALLER
1251  *
1252  * Enable an implementation of SHA-256 that has lower ROM footprint but also
1253  * lower performance.
1254  *
1255  * The default implementation is meant to be a reasonnable compromise between
1256  * performance and size. This version optimizes more aggressively for size at
1257  * the expense of performance. Eg on Cortex-M4 it reduces the size of
1258  * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
1259  * 30%.
1260  *
1261  * Uncomment to enable the smaller implementation of SHA256.
1262  */
1263 //#define MBEDTLS_SHA256_SMALLER
1264 
1265 /**
1266  * \def MBEDTLS_SHA512_SMALLER
1267  *
1268  * Enable an implementation of SHA-512 that has lower ROM footprint but also
1269  * lower performance.
1270  *
1271  * Uncomment to enable the smaller implementation of SHA512.
1272  */
1273 //#define MBEDTLS_SHA512_SMALLER
1274 
1275 /**
1276  * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
1277  *
1278  * Enable sending of alert messages in case of encountered errors as per RFC.
1279  * If you choose not to send the alert messages, mbed TLS can still communicate
1280  * with other servers, only debugging of failures is harder.
1281  *
1282  * The advantage of not sending alert messages, is that no information is given
1283  * about reasons for failures thus preventing adversaries of gaining intel.
1284  *
1285  * Enable sending of all alert messages
1286  */
1287 #define MBEDTLS_SSL_ALL_ALERT_MESSAGES
1288 
1289 /**
1290  * \def MBEDTLS_SSL_DTLS_CONNECTION_ID
1291  *
1292  * Enable support for the DTLS Connection ID extension
1293  * (version draft-ietf-tls-dtls-connection-id-05,
1294  * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05)
1295  * which allows to identify DTLS connections across changes
1296  * in the underlying transport.
1297  *
1298  * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`,
1299  * `mbedtls_ssl_get_peer_cid()` and `mbedtls_ssl_conf_cid()`.
1300  * See the corresponding documentation for more information.
1301  *
1302  * \warning The Connection ID extension is still in draft state.
1303  *          We make no stability promises for the availability
1304  *          or the shape of the API controlled by this option.
1305  *
1306  * The maximum lengths of outgoing and incoming CIDs can be configured
1307  * through the options
1308  * - MBEDTLS_SSL_CID_OUT_LEN_MAX
1309  * - MBEDTLS_SSL_CID_IN_LEN_MAX.
1310  *
1311  * Requires: MBEDTLS_SSL_PROTO_DTLS
1312  *
1313  * Uncomment to enable the Connection ID extension.
1314  */
1315 //#define MBEDTLS_SSL_DTLS_CONNECTION_ID
1316 
1317 /**
1318  * \def MBEDTLS_SSL_ASYNC_PRIVATE
1319  *
1320  * Enable asynchronous external private key operations in SSL. This allows
1321  * you to configure an SSL connection to call an external cryptographic
1322  * module to perform private key operations instead of performing the
1323  * operation inside the library.
1324  *
1325  */
1326 //#define MBEDTLS_SSL_ASYNC_PRIVATE
1327 
1328 /**
1329  * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION
1330  *
1331  * Enable serialization of the TLS context structures, through use of the
1332  * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
1333  *
1334  * This pair of functions allows one side of a connection to serialize the
1335  * context associated with the connection, then free or re-use that context
1336  * while the serialized state is persisted elsewhere, and finally deserialize
1337  * that state to a live context for resuming read/write operations on the
1338  * connection. From a protocol perspective, the state of the connection is
1339  * unaffected, in particular this is entirely transparent to the peer.
1340  *
1341  * Note: this is distinct from TLS session resumption, which is part of the
1342  * protocol and fully visible by the peer. TLS session resumption enables
1343  * establishing new connections associated to a saved session with shorter,
1344  * lighter handshakes, while context serialization is a local optimization in
1345  * handling a single, potentially long-lived connection.
1346  *
1347  * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are
1348  * saved after the handshake to allow for more efficient serialization, so if
1349  * you don't need this feature you'll save RAM by disabling it.
1350  *
1351  * Comment to disable the context serialization APIs.
1352  */
1353 #define MBEDTLS_SSL_CONTEXT_SERIALIZATION
1354 
1355 /**
1356  * \def MBEDTLS_SSL_DEBUG_ALL
1357  *
1358  * Enable the debug messages in SSL module for all issues.
1359  * Debug messages have been disabled in some places to prevent timing
1360  * attacks due to (unbalanced) debugging function calls.
1361  *
1362  * If you need all error reporting you should enable this during debugging,
1363  * but remove this for production servers that should log as well.
1364  *
1365  * Uncomment this macro to report all debug messages on errors introducing
1366  * a timing side-channel.
1367  *
1368  */
1369 //#define MBEDTLS_SSL_DEBUG_ALL
1370 
1371 /** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
1372  *
1373  * Enable support for Encrypt-then-MAC, RFC 7366.
1374  *
1375  * This allows peers that both support it to use a more robust protection for
1376  * ciphersuites using CBC, providing deep resistance against timing attacks
1377  * on the padding or underlying cipher.
1378  *
1379  * This only affects CBC ciphersuites, and is useless if none is defined.
1380  *
1381  * Requires: MBEDTLS_SSL_PROTO_TLS1_2
1382  *
1383  * Comment this macro to disable support for Encrypt-then-MAC
1384  */
1385 #define MBEDTLS_SSL_ENCRYPT_THEN_MAC
1386 
1387 /** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
1388  *
1389  * Enable support for RFC 7627: Session Hash and Extended Master Secret
1390  * Extension.
1391  *
1392  * This was introduced as "the proper fix" to the Triple Handshake familiy of
1393  * attacks, but it is recommended to always use it (even if you disable
1394  * renegotiation), since it actually fixes a more fundamental issue in the
1395  * original SSL/TLS design, and has implications beyond Triple Handshake.
1396  *
1397  * Requires: MBEDTLS_SSL_PROTO_TLS1_2
1398  *
1399  * Comment this macro to disable support for Extended Master Secret.
1400  */
1401 #define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
1402 
1403 /**
1404  * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
1405  *
1406  * This option controls the availability of the API mbedtls_ssl_get_peer_cert()
1407  * giving access to the peer's certificate after completion of the handshake.
1408  *
1409  * Unless you need mbedtls_ssl_peer_cert() in your application, it is
1410  * recommended to disable this option for reduced RAM usage.
1411  *
1412  * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still
1413  *       defined, but always returns \c NULL.
1414  *
1415  * \note This option has no influence on the protection against the
1416  *       triple handshake attack. Even if it is disabled, Mbed TLS will
1417  *       still ensure that certificates do not change during renegotiation,
1418  *       for exaple by keeping a hash of the peer's certificate.
1419  *
1420  * Comment this macro to disable storing the peer's certificate
1421  * after the handshake.
1422  */
1423 #define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
1424 
1425 /**
1426  * \def MBEDTLS_SSL_RENEGOTIATION
1427  *
1428  * Enable support for TLS renegotiation.
1429  *
1430  * The two main uses of renegotiation are (1) refresh keys on long-lived
1431  * connections and (2) client authentication after the initial handshake.
1432  * If you don't need renegotiation, it's probably better to disable it, since
1433  * it has been associated with security issues in the past and is easy to
1434  * misuse/misunderstand.
1435  *
1436  * Comment this to disable support for renegotiation.
1437  *
1438  * \note   Even if this option is disabled, both client and server are aware
1439  *         of the Renegotiation Indication Extension (RFC 5746) used to
1440  *         prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
1441  *         (See \c mbedtls_ssl_conf_legacy_renegotiation for the
1442  *          configuration of this extension).
1443  *
1444  */
1445 #define MBEDTLS_SSL_RENEGOTIATION
1446 
1447 /**
1448  * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1449  *
1450  * Enable support for RFC 6066 max_fragment_length extension in SSL.
1451  *
1452  * Comment this macro to disable support for the max_fragment_length extension
1453  */
1454 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1455 
1456 /**
1457  * \def MBEDTLS_SSL_PROTO_TLS1_2
1458  *
1459  * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
1460  *
1461  * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
1462  *           (Depends on ciphersuites)
1463  *
1464  * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
1465  */
1466 #define MBEDTLS_SSL_PROTO_TLS1_2
1467 
1468 /**
1469  * \def MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL
1470  *
1471  * This macro is used to selectively enable experimental parts
1472  * of the code that contribute to the ongoing development of
1473  * the prototype TLS 1.3 and DTLS 1.3 implementation, and provide
1474  * no other purpose.
1475  *
1476  * \warning TLS 1.3 and DTLS 1.3 aren't yet supported in Mbed TLS,
1477  *          and no feature exposed through this macro is part of the
1478  *          public API. In particular, features under the control
1479  *          of this macro are experimental and don't come with any
1480  *          stability guarantees.
1481  *
1482  * Uncomment this macro to enable experimental and partial
1483  * functionality specific to TLS 1.3.
1484  */
1485 //#define MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL
1486 
1487 /**
1488  * \def MBEDTLS_SSL_PROTO_DTLS
1489  *
1490  * Enable support for DTLS (all available versions).
1491  *
1492  * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
1493  *
1494  * Requires: MBEDTLS_SSL_PROTO_TLS1_2
1495  *
1496  * Comment this macro to disable support for DTLS
1497  */
1498 #define MBEDTLS_SSL_PROTO_DTLS
1499 
1500 /**
1501  * \def MBEDTLS_SSL_ALPN
1502  *
1503  * Enable support for RFC 7301 Application Layer Protocol Negotiation.
1504  *
1505  * Comment this macro to disable support for ALPN.
1506  */
1507 #define MBEDTLS_SSL_ALPN
1508 
1509 /**
1510  * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
1511  *
1512  * Enable support for the anti-replay mechanism in DTLS.
1513  *
1514  * Requires: MBEDTLS_SSL_TLS_C
1515  *           MBEDTLS_SSL_PROTO_DTLS
1516  *
1517  * \warning Disabling this is often a security risk!
1518  * See mbedtls_ssl_conf_dtls_anti_replay() for details.
1519  *
1520  * Comment this to disable anti-replay in DTLS.
1521  */
1522 #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
1523 
1524 /**
1525  * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
1526  *
1527  * Enable support for HelloVerifyRequest on DTLS servers.
1528  *
1529  * This feature is highly recommended to prevent DTLS servers being used as
1530  * amplifiers in DoS attacks against other hosts. It should always be enabled
1531  * unless you know for sure amplification cannot be a problem in the
1532  * environment in which your server operates.
1533  *
1534  * \warning Disabling this can ba a security risk! (see above)
1535  *
1536  * Requires: MBEDTLS_SSL_PROTO_DTLS
1537  *
1538  * Comment this to disable support for HelloVerifyRequest.
1539  */
1540 #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
1541 
1542 /**
1543  * \def MBEDTLS_SSL_DTLS_SRTP
1544  *
1545  * Enable support for negotiation of DTLS-SRTP (RFC 5764)
1546  * through the use_srtp extension.
1547  *
1548  * \note This feature provides the minimum functionality required
1549  * to negotiate the use of DTLS-SRTP and to allow the derivation of
1550  * the associated SRTP packet protection key material.
1551  * In particular, the SRTP packet protection itself, as well as the
1552  * demultiplexing of RTP and DTLS packets at the datagram layer
1553  * (see Section 5 of RFC 5764), are not handled by this feature.
1554  * Instead, after successful completion of a handshake negotiating
1555  * the use of DTLS-SRTP, the extended key exporter API
1556  * mbedtls_ssl_conf_export_keys_cb() should be used to implement
1557  * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
1558  * (this is implemented in the SSL example programs).
1559  * The resulting key should then be passed to an SRTP stack.
1560  *
1561  * Setting this option enables the runtime API
1562  * mbedtls_ssl_conf_dtls_srtp_protection_profiles()
1563  * through which the supported DTLS-SRTP protection
1564  * profiles can be configured. You must call this API at
1565  * runtime if you wish to negotiate the use of DTLS-SRTP.
1566  *
1567  * Requires: MBEDTLS_SSL_PROTO_DTLS
1568  *
1569  * Uncomment this to enable support for use_srtp extension.
1570  */
1571 //#define MBEDTLS_SSL_DTLS_SRTP
1572 
1573 /**
1574  * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1575  *
1576  * Enable server-side support for clients that reconnect from the same port.
1577  *
1578  * Some clients unexpectedly close the connection and try to reconnect using the
1579  * same source port. This needs special support from the server to handle the
1580  * new connection securely, as described in section 4.2.8 of RFC 6347. This
1581  * flag enables that support.
1582  *
1583  * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
1584  *
1585  * Comment this to disable support for clients reusing the source port.
1586  */
1587 #define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1588 
1589 /**
1590  * \def MBEDTLS_SSL_SESSION_TICKETS
1591  *
1592  * Enable support for RFC 5077 session tickets in SSL.
1593  * Client-side, provides full support for session tickets (maintenance of a
1594  * session store remains the responsibility of the application, though).
1595  * Server-side, you also need to provide callbacks for writing and parsing
1596  * tickets, including authenticated encryption and key management. Example
1597  * callbacks are provided by MBEDTLS_SSL_TICKET_C.
1598  *
1599  * Comment this macro to disable support for SSL session tickets
1600  */
1601 #define MBEDTLS_SSL_SESSION_TICKETS
1602 
1603 /**
1604  * \def MBEDTLS_SSL_EXPORT_KEYS
1605  *
1606  * Enable support for exporting key block and master secret.
1607  * This is required for certain users of TLS, e.g. EAP-TLS.
1608  *
1609  * Comment this macro to disable support for key export
1610  */
1611 #define MBEDTLS_SSL_EXPORT_KEYS
1612 
1613 /**
1614  * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
1615  *
1616  * Enable support for RFC 6066 server name indication (SNI) in SSL.
1617  *
1618  * Requires: MBEDTLS_X509_CRT_PARSE_C
1619  *
1620  * Comment this macro to disable support for server name indication in SSL
1621  */
1622 #define MBEDTLS_SSL_SERVER_NAME_INDICATION
1623 
1624 /**
1625  * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
1626  *
1627  * When this option is enabled, the SSL buffer will be resized automatically
1628  * based on the negotiated maximum fragment length in each direction.
1629  *
1630  * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1631  */
1632 //#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
1633 
1634 /**
1635  * \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
1636  *
1637  * Enable testing of the constant-flow nature of some sensitive functions with
1638  * clang's MemorySanitizer. This causes some existing tests to also test
1639  * this non-functional property of the code under test.
1640  *
1641  * This setting requires compiling with clang -fsanitize=memory. The test
1642  * suites can then be run normally.
1643  *
1644  * \warning This macro is only used for extended testing; it is not considered
1645  * part of the library's API, so it may change or disappear at any time.
1646  *
1647  * Uncomment to enable testing of the constant-flow nature of selected code.
1648  */
1649 //#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
1650 
1651 /**
1652  * \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
1653  *
1654  * Enable testing of the constant-flow nature of some sensitive functions with
1655  * valgrind's memcheck tool. This causes some existing tests to also test
1656  * this non-functional property of the code under test.
1657  *
1658  * This setting requires valgrind headers for building, and is only useful for
1659  * testing if the tests suites are run with valgrind's memcheck. This can be
1660  * done for an individual test suite with 'valgrind ./test_suite_xxx', or when
1661  * using CMake, this can be done for all test suites with 'make memcheck'.
1662  *
1663  * \warning This macro is only used for extended testing; it is not considered
1664  * part of the library's API, so it may change or disappear at any time.
1665  *
1666  * Uncomment to enable testing of the constant-flow nature of selected code.
1667  */
1668 //#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
1669 
1670 /**
1671  * \def MBEDTLS_TEST_HOOKS
1672  *
1673  * Enable features for invasive testing such as introspection functions and
1674  * hooks for fault injection. This enables additional unit tests.
1675  *
1676  * Merely enabling this feature should not change the behavior of the product.
1677  * It only adds new code, and new branching points where the default behavior
1678  * is the same as when this feature is disabled.
1679  * However, this feature increases the attack surface: there is an added
1680  * risk of vulnerabilities, and more gadgets that can make exploits easier.
1681  * Therefore this feature must never be enabled in production.
1682  *
1683  * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more
1684  * information.
1685  *
1686  * Uncomment to enable invasive tests.
1687  */
1688 //#define MBEDTLS_TEST_HOOKS
1689 
1690 /**
1691  * \def MBEDTLS_THREADING_ALT
1692  *
1693  * Provide your own alternate threading implementation.
1694  *
1695  * Requires: MBEDTLS_THREADING_C
1696  *
1697  * Uncomment this to allow your own alternate threading implementation.
1698  */
1699 //#define MBEDTLS_THREADING_ALT
1700 
1701 /**
1702  * \def MBEDTLS_THREADING_PTHREAD
1703  *
1704  * Enable the pthread wrapper layer for the threading layer.
1705  *
1706  * Requires: MBEDTLS_THREADING_C
1707  *
1708  * Uncomment this to enable pthread mutexes.
1709  */
1710 //#define MBEDTLS_THREADING_PTHREAD
1711 
1712 /**
1713  * \def MBEDTLS_USE_PSA_CRYPTO
1714  *
1715  * Make the X.509 and TLS library use PSA for cryptographic operations, and
1716  * enable new APIs for using keys handled by PSA Crypto.
1717  *
1718  * \note Development of this option is currently in progress, and parts of Mbed
1719  * TLS's X.509 and TLS modules are not ported to PSA yet. However, these parts
1720  * will still continue to work as usual, so enabling this option should not
1721  * break backwards compatibility.
1722  *
1723  * \warning The PSA Crypto API is in beta stage. While you're welcome to
1724  * experiment using it, incompatible API changes are still possible, and some
1725  * parts may not have reached the same quality as the rest of Mbed TLS yet.
1726  *
1727  * \warning This option enables new Mbed TLS APIs that are dependent on the
1728  * PSA Crypto API, so can't come with the same stability guarantees as the
1729  * rest of the Mbed TLS APIs. You're welcome to experiment with them, but for
1730  * now, access to these APIs is opt-in (via enabling the present option), in
1731  * order to clearly differentiate them from the stable Mbed TLS APIs.
1732  *
1733  * Requires: MBEDTLS_PSA_CRYPTO_C.
1734  *
1735  * Uncomment this to enable internal use of PSA Crypto and new associated APIs.
1736  */
1737 //#define MBEDTLS_USE_PSA_CRYPTO
1738 
1739 /**
1740  * \def MBEDTLS_PSA_CRYPTO_CONFIG
1741  *
1742  * This setting allows support for cryptographic mechanisms through the PSA
1743  * API to be configured separately from support through the mbedtls API.
1744  *
1745  * Uncomment this to enable use of PSA Crypto configuration settings which
1746  * can be found in include/psa/crypto_config.h.
1747  *
1748  * This feature is still experimental and is not ready for production since
1749  * it is not completed.
1750  */
1751 //#define MBEDTLS_PSA_CRYPTO_CONFIG
1752 
1753 /**
1754  * \def MBEDTLS_VERSION_FEATURES
1755  *
1756  * Allow run-time checking of compile-time enabled features. Thus allowing users
1757  * to check at run-time if the library is for instance compiled with threading
1758  * support via mbedtls_version_check_feature().
1759  *
1760  * Requires: MBEDTLS_VERSION_C
1761  *
1762  * Comment this to disable run-time checking and save ROM space
1763  */
1764 #define MBEDTLS_VERSION_FEATURES
1765 
1766 /**
1767  * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1768  *
1769  * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()`
1770  * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure
1771  * the set of trusted certificates through a callback instead of a linked
1772  * list.
1773  *
1774  * This is useful for example in environments where a large number of trusted
1775  * certificates is present and storing them in a linked list isn't efficient
1776  * enough, or when the set of trusted certificates changes frequently.
1777  *
1778  * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and
1779  * `mbedtls_ssl_conf_ca_cb()` for more information.
1780  *
1781  * Uncomment to enable trusted certificate callbacks.
1782  */
1783 //#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1784 
1785 /**
1786  * \def MBEDTLS_X509_REMOVE_INFO
1787  *
1788  * Disable mbedtls_x509_*_info() and related APIs.
1789  *
1790  * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt()
1791  * and other functions/constants only used by these functions, thus reducing
1792  * the code footprint by several KB.
1793  */
1794 //#define MBEDTLS_X509_REMOVE_INFO
1795 
1796 /**
1797  * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
1798  *
1799  * Enable parsing and verification of X.509 certificates, CRLs and CSRS
1800  * signed with RSASSA-PSS (aka PKCS#1 v2.1).
1801  *
1802  * Comment this macro to disallow using RSASSA-PSS in certificates.
1803  */
1804 #define MBEDTLS_X509_RSASSA_PSS_SUPPORT
1805 /* \} name SECTION: mbed TLS feature support */
1806 
1807 /**
1808  * \name SECTION: mbed TLS modules
1809  *
1810  * This section enables or disables entire modules in mbed TLS
1811  * \{
1812  */
1813 
1814 /**
1815  * \def MBEDTLS_AESNI_C
1816  *
1817  * Enable AES-NI support on x86-64.
1818  *
1819  * Module:  library/aesni.c
1820  * Caller:  library/aes.c
1821  *
1822  * Requires: MBEDTLS_HAVE_ASM
1823  *
1824  * This modules adds support for the AES-NI instructions on x86-64
1825  */
1826 #define MBEDTLS_AESNI_C
1827 
1828 /**
1829  * \def MBEDTLS_AES_C
1830  *
1831  * Enable the AES block cipher.
1832  *
1833  * Module:  library/aes.c
1834  * Caller:  library/cipher.c
1835  *          library/pem.c
1836  *          library/ctr_drbg.c
1837  *
1838  * This module enables the following ciphersuites (if other requisites are
1839  * enabled as well):
1840  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
1841  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
1842  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
1843  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
1844  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
1845  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
1846  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
1847  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
1848  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
1849  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
1850  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
1851  *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
1852  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
1853  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
1854  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
1855  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
1856  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
1857  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
1858  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
1859  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
1860  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
1861  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
1862  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
1863  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
1864  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
1865  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
1866  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
1867  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
1868  *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
1869  *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
1870  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
1871  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
1872  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
1873  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
1874  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
1875  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
1876  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
1877  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
1878  *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
1879  *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
1880  *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
1881  *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
1882  *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
1883  *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
1884  *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
1885  *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
1886  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
1887  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
1888  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
1889  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
1890  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
1891  *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
1892  *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
1893  *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
1894  *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
1895  *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
1896  *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
1897  *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
1898  *
1899  * PEM_PARSE uses AES for decrypting encrypted keys.
1900  */
1901 #define MBEDTLS_AES_C
1902 
1903 /**
1904  * \def MBEDTLS_ASN1_PARSE_C
1905  *
1906  * Enable the generic ASN1 parser.
1907  *
1908  * Module:  library/asn1.c
1909  * Caller:  library/x509.c
1910  *          library/dhm.c
1911  *          library/pkcs12.c
1912  *          library/pkcs5.c
1913  *          library/pkparse.c
1914  */
1915 #define MBEDTLS_ASN1_PARSE_C
1916 
1917 /**
1918  * \def MBEDTLS_ASN1_WRITE_C
1919  *
1920  * Enable the generic ASN1 writer.
1921  *
1922  * Module:  library/asn1write.c
1923  * Caller:  library/ecdsa.c
1924  *          library/pkwrite.c
1925  *          library/x509_create.c
1926  *          library/x509write_crt.c
1927  *          library/x509write_csr.c
1928  */
1929 #define MBEDTLS_ASN1_WRITE_C
1930 
1931 /**
1932  * \def MBEDTLS_BASE64_C
1933  *
1934  * Enable the Base64 module.
1935  *
1936  * Module:  library/base64.c
1937  * Caller:  library/pem.c
1938  *
1939  * This module is required for PEM support (required by X.509).
1940  */
1941 #define MBEDTLS_BASE64_C
1942 
1943 /**
1944  * \def MBEDTLS_BIGNUM_C
1945  *
1946  * Enable the multi-precision integer library.
1947  *
1948  * Module:  library/bignum.c
1949  * Caller:  library/dhm.c
1950  *          library/ecp.c
1951  *          library/ecdsa.c
1952  *          library/rsa.c
1953  *          library/rsa_alt_helpers.c
1954  *          library/ssl_tls.c
1955  *
1956  * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
1957  */
1958 #define MBEDTLS_BIGNUM_C
1959 
1960 /**
1961  * \def MBEDTLS_CAMELLIA_C
1962  *
1963  * Enable the Camellia block cipher.
1964  *
1965  * Module:  library/camellia.c
1966  * Caller:  library/cipher.c
1967  *
1968  * This module enables the following ciphersuites (if other requisites are
1969  * enabled as well):
1970  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1971  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1972  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
1973  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
1974  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1975  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1976  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
1977  *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
1978  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1979  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1980  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1981  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1982  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
1983  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
1984  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
1985  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1986  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1987  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1988  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1989  *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1990  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1991  *      MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1992  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
1993  *      MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1994  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1995  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
1996  *      MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1997  *      MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1998  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1999  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
2000  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
2001  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
2002  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
2003  *      MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
2004  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
2005  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
2006  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
2007  *      MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
2008  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
2009  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
2010  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
2011  *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
2012  */
2013 #define MBEDTLS_CAMELLIA_C
2014 
2015 /**
2016  * \def MBEDTLS_ARIA_C
2017  *
2018  * Enable the ARIA block cipher.
2019  *
2020  * Module:  library/aria.c
2021  * Caller:  library/cipher.c
2022  *
2023  * This module enables the following ciphersuites (if other requisites are
2024  * enabled as well):
2025  *
2026  *      MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256
2027  *      MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384
2028  *      MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256
2029  *      MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384
2030  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256
2031  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384
2032  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256
2033  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384
2034  *      MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256
2035  *      MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384
2036  *      MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256
2037  *      MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384
2038  *      MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256
2039  *      MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384
2040  *      MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256
2041  *      MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384
2042  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256
2043  *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384
2044  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256
2045  *      MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384
2046  *      MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256
2047  *      MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384
2048  *      MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256
2049  *      MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384
2050  *      MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256
2051  *      MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384
2052  *      MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256
2053  *      MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384
2054  *      MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256
2055  *      MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384
2056  *      MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256
2057  *      MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384
2058  *      MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256
2059  *      MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384
2060  *      MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256
2061  *      MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384
2062  *      MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256
2063  *      MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384
2064  */
2065 #define MBEDTLS_ARIA_C
2066 
2067 /**
2068  * \def MBEDTLS_CCM_C
2069  *
2070  * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
2071  *
2072  * Module:  library/ccm.c
2073  *
2074  * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
2075  *
2076  * This module enables the AES-CCM ciphersuites, if other requisites are
2077  * enabled as well.
2078  */
2079 #define MBEDTLS_CCM_C
2080 
2081 /**
2082  * \def MBEDTLS_CHACHA20_C
2083  *
2084  * Enable the ChaCha20 stream cipher.
2085  *
2086  * Module:  library/chacha20.c
2087  */
2088 #define MBEDTLS_CHACHA20_C
2089 
2090 /**
2091  * \def MBEDTLS_CHACHAPOLY_C
2092  *
2093  * Enable the ChaCha20-Poly1305 AEAD algorithm.
2094  *
2095  * Module:  library/chachapoly.c
2096  *
2097  * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
2098  */
2099 #define MBEDTLS_CHACHAPOLY_C
2100 
2101 /**
2102  * \def MBEDTLS_CIPHER_C
2103  *
2104  * Enable the generic cipher layer.
2105  *
2106  * Module:  library/cipher.c
2107  * Caller:  library/ssl_tls.c
2108  *
2109  * Uncomment to enable generic cipher wrappers.
2110  */
2111 #define MBEDTLS_CIPHER_C
2112 
2113 /**
2114  * \def MBEDTLS_CMAC_C
2115  *
2116  * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
2117  * ciphers.
2118  *
2119  * \note When #MBEDTLS_CMAC_ALT is active, meaning that the underlying
2120  *       implementation of the CMAC algorithm is provided by an alternate
2121  *       implementation, that alternate implementation may opt to not support
2122  *       AES-192 or 3DES as underlying block ciphers for the CMAC operation.
2123  *
2124  * Module:  library/cmac.c
2125  *
2126  * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
2127  *
2128  */
2129 #define MBEDTLS_CMAC_C
2130 
2131 /**
2132  * \def MBEDTLS_CTR_DRBG_C
2133  *
2134  * Enable the CTR_DRBG AES-based random generator.
2135  * The CTR_DRBG generator uses AES-256 by default.
2136  * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above.
2137  *
2138  * \note To achieve a 256-bit security strength with CTR_DRBG,
2139  *       you must use AES-256 *and* use sufficient entropy.
2140  *       See ctr_drbg.h for more details.
2141  *
2142  * Module:  library/ctr_drbg.c
2143  * Caller:
2144  *
2145  * Requires: MBEDTLS_AES_C
2146  *
2147  * This module provides the CTR_DRBG AES random number generator.
2148  */
2149 #define MBEDTLS_CTR_DRBG_C
2150 
2151 /**
2152  * \def MBEDTLS_DEBUG_C
2153  *
2154  * Enable the debug functions.
2155  *
2156  * Module:  library/debug.c
2157  * Caller:  library/ssl_cli.c
2158  *          library/ssl_srv.c
2159  *          library/ssl_tls.c
2160  *
2161  * This module provides debugging functions.
2162  */
2163 #define MBEDTLS_DEBUG_C
2164 
2165 /**
2166  * \def MBEDTLS_DES_C
2167  *
2168  * Enable the DES block cipher.
2169  *
2170  * Module:  library/des.c
2171  * Caller:  library/pem.c
2172  *          library/cipher.c
2173  *
2174  * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
2175  *
2176  * \warning   DES is considered a weak cipher and its use constitutes a
2177  *            security risk. We recommend considering stronger ciphers instead.
2178  */
2179 #define MBEDTLS_DES_C
2180 
2181 /**
2182  * \def MBEDTLS_DHM_C
2183  *
2184  * Enable the Diffie-Hellman-Merkle module.
2185  *
2186  * Module:  library/dhm.c
2187  * Caller:  library/ssl_cli.c
2188  *          library/ssl_srv.c
2189  *
2190  * This module is used by the following key exchanges:
2191  *      DHE-RSA, DHE-PSK
2192  *
2193  * \warning    Using DHE constitutes a security risk as it
2194  *             is not possible to validate custom DH parameters.
2195  *             If possible, it is recommended users should consider
2196  *             preferring other methods of key exchange.
2197  *             See dhm.h for more details.
2198  *
2199  */
2200 #define MBEDTLS_DHM_C
2201 
2202 /**
2203  * \def MBEDTLS_ECDH_C
2204  *
2205  * Enable the elliptic curve Diffie-Hellman library.
2206  *
2207  * Module:  library/ecdh.c
2208  * Caller:  library/ssl_cli.c
2209  *          library/ssl_srv.c
2210  *
2211  * This module is used by the following key exchanges:
2212  *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
2213  *
2214  * Requires: MBEDTLS_ECP_C
2215  */
2216 #define MBEDTLS_ECDH_C
2217 
2218 /**
2219  * \def MBEDTLS_ECDSA_C
2220  *
2221  * Enable the elliptic curve DSA library.
2222  *
2223  * Module:  library/ecdsa.c
2224  * Caller:
2225  *
2226  * This module is used by the following key exchanges:
2227  *      ECDHE-ECDSA
2228  *
2229  * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C,
2230  *           and at least one MBEDTLS_ECP_DP_XXX_ENABLED for a
2231  *           short Weierstrass curve.
2232  */
2233 #define MBEDTLS_ECDSA_C
2234 
2235 /**
2236  * \def MBEDTLS_ECJPAKE_C
2237  *
2238  * Enable the elliptic curve J-PAKE library.
2239  *
2240  * \note EC J-PAKE support is based on the Thread v1.0.0 specification.
2241  *       It has not been reviewed for compliance with newer standards such as
2242  *       Thread v1.1 or RFC 8236.
2243  *
2244  * Module:  library/ecjpake.c
2245  * Caller:
2246  *
2247  * This module is used by the following key exchanges:
2248  *      ECJPAKE
2249  *
2250  * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
2251  */
2252 #define MBEDTLS_ECJPAKE_C
2253 
2254 /**
2255  * \def MBEDTLS_ECP_C
2256  *
2257  * Enable the elliptic curve over GF(p) library.
2258  *
2259  * Module:  library/ecp.c
2260  * Caller:  library/ecdh.c
2261  *          library/ecdsa.c
2262  *          library/ecjpake.c
2263  *
2264  * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
2265  */
2266 #define MBEDTLS_ECP_C
2267 
2268 /**
2269  * \def MBEDTLS_ENTROPY_C
2270  *
2271  * Enable the platform-specific entropy code.
2272  *
2273  * Module:  library/entropy.c
2274  * Caller:
2275  *
2276  * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
2277  *
2278  * This module provides a generic entropy pool
2279  */
2280 #define MBEDTLS_ENTROPY_C
2281 
2282 /**
2283  * \def MBEDTLS_ERROR_C
2284  *
2285  * Enable error code to error string conversion.
2286  *
2287  * Module:  library/error.c
2288  * Caller:
2289  *
2290  * This module enables mbedtls_strerror().
2291  */
2292 #define MBEDTLS_ERROR_C
2293 
2294 /**
2295  * \def MBEDTLS_GCM_C
2296  *
2297  * Enable the Galois/Counter Mode (GCM).
2298  *
2299  * Module:  library/gcm.c
2300  *
2301  * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or MBEDTLS_ARIA_C
2302  *
2303  * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
2304  * requisites are enabled as well.
2305  */
2306 #define MBEDTLS_GCM_C
2307 
2308 /**
2309  * \def MBEDTLS_HKDF_C
2310  *
2311  * Enable the HKDF algorithm (RFC 5869).
2312  *
2313  * Module:  library/hkdf.c
2314  * Caller:
2315  *
2316  * Requires: MBEDTLS_MD_C
2317  *
2318  * This module adds support for the Hashed Message Authentication Code
2319  * (HMAC)-based key derivation function (HKDF).
2320  */
2321 #define MBEDTLS_HKDF_C
2322 
2323 /**
2324  * \def MBEDTLS_HMAC_DRBG_C
2325  *
2326  * Enable the HMAC_DRBG random generator.
2327  *
2328  * Module:  library/hmac_drbg.c
2329  * Caller:
2330  *
2331  * Requires: MBEDTLS_MD_C
2332  *
2333  * Uncomment to enable the HMAC_DRBG random number geerator.
2334  */
2335 #define MBEDTLS_HMAC_DRBG_C
2336 
2337 /**
2338  * \def MBEDTLS_NIST_KW_C
2339  *
2340  * Enable the Key Wrapping mode for 128-bit block ciphers,
2341  * as defined in NIST SP 800-38F. Only KW and KWP modes
2342  * are supported. At the moment, only AES is approved by NIST.
2343  *
2344  * Module:  library/nist_kw.c
2345  *
2346  * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C
2347  */
2348 #define MBEDTLS_NIST_KW_C
2349 
2350 /**
2351  * \def MBEDTLS_MD_C
2352  *
2353  * Enable the generic message digest layer.
2354  *
2355  * Module:  library/md.c
2356  * Caller:
2357  *
2358  * Uncomment to enable generic message digest wrappers.
2359  */
2360 #define MBEDTLS_MD_C
2361 
2362 /**
2363  * \def MBEDTLS_MD5_C
2364  *
2365  * Enable the MD5 hash algorithm.
2366  *
2367  * Module:  library/md5.c
2368  * Caller:  library/md.c
2369  *          library/pem.c
2370  *          library/ssl_tls.c
2371  *
2372  * This module is required for TLS 1.2 depending on the handshake parameters.
2373  * Further, it is used for checking MD5-signed certificates, and for PBKDF1
2374  * when decrypting PEM-encoded encrypted keys.
2375  *
2376  * \warning   MD5 is considered a weak message digest and its use constitutes a
2377  *            security risk. If possible, we recommend avoiding dependencies on
2378  *            it, and considering stronger message digests instead.
2379  *
2380  */
2381 #define MBEDTLS_MD5_C
2382 
2383 /**
2384  * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
2385  *
2386  * Enable the buffer allocator implementation that makes use of a (stack)
2387  * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
2388  * calls)
2389  *
2390  * Module:  library/memory_buffer_alloc.c
2391  *
2392  * Requires: MBEDTLS_PLATFORM_C
2393  *           MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
2394  *
2395  * Enable this module to enable the buffer memory allocator.
2396  */
2397 #define MBEDTLS_MEMORY_BUFFER_ALLOC_C
2398 
2399 /**
2400  * \def MBEDTLS_NET_C
2401  *
2402  * Enable the TCP and UDP over IPv6/IPv4 networking routines.
2403  *
2404  * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
2405  * and Windows. For other platforms, you'll want to disable it, and write your
2406  * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
2407  *
2408  * \note See also our Knowledge Base article about porting to a new
2409  * environment:
2410  * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
2411  *
2412  * Module:  library/net_sockets.c
2413  *
2414  * This module provides networking routines.
2415  */
2416 #define MBEDTLS_NET_C
2417 
2418 /**
2419  * \def MBEDTLS_OID_C
2420  *
2421  * Enable the OID database.
2422  *
2423  * Module:  library/oid.c
2424  * Caller:  library/asn1write.c
2425  *          library/pkcs5.c
2426  *          library/pkparse.c
2427  *          library/pkwrite.c
2428  *          library/rsa.c
2429  *          library/x509.c
2430  *          library/x509_create.c
2431  *          library/x509_crl.c
2432  *          library/x509_crt.c
2433  *          library/x509_csr.c
2434  *          library/x509write_crt.c
2435  *          library/x509write_csr.c
2436  *
2437  * This modules translates between OIDs and internal values.
2438  */
2439 #define MBEDTLS_OID_C
2440 
2441 /**
2442  * \def MBEDTLS_PADLOCK_C
2443  *
2444  * Enable VIA Padlock support on x86.
2445  *
2446  * Module:  library/padlock.c
2447  * Caller:  library/aes.c
2448  *
2449  * Requires: MBEDTLS_HAVE_ASM
2450  *
2451  * This modules adds support for the VIA PadLock on x86.
2452  */
2453 #define MBEDTLS_PADLOCK_C
2454 
2455 /**
2456  * \def MBEDTLS_PEM_PARSE_C
2457  *
2458  * Enable PEM decoding / parsing.
2459  *
2460  * Module:  library/pem.c
2461  * Caller:  library/dhm.c
2462  *          library/pkparse.c
2463  *          library/x509_crl.c
2464  *          library/x509_crt.c
2465  *          library/x509_csr.c
2466  *
2467  * Requires: MBEDTLS_BASE64_C
2468  *
2469  * This modules adds support for decoding / parsing PEM files.
2470  */
2471 #define MBEDTLS_PEM_PARSE_C
2472 
2473 /**
2474  * \def MBEDTLS_PEM_WRITE_C
2475  *
2476  * Enable PEM encoding / writing.
2477  *
2478  * Module:  library/pem.c
2479  * Caller:  library/pkwrite.c
2480  *          library/x509write_crt.c
2481  *          library/x509write_csr.c
2482  *
2483  * Requires: MBEDTLS_BASE64_C
2484  *
2485  * This modules adds support for encoding / writing PEM files.
2486  */
2487 #define MBEDTLS_PEM_WRITE_C
2488 
2489 /**
2490  * \def MBEDTLS_PK_C
2491  *
2492  * Enable the generic public (asymetric) key layer.
2493  *
2494  * Module:  library/pk.c
2495  * Caller:  library/ssl_tls.c
2496  *          library/ssl_cli.c
2497  *          library/ssl_srv.c
2498  *
2499  * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
2500  *
2501  * Uncomment to enable generic public key wrappers.
2502  */
2503 #define MBEDTLS_PK_C
2504 
2505 /**
2506  * \def MBEDTLS_PK_PARSE_C
2507  *
2508  * Enable the generic public (asymetric) key parser.
2509  *
2510  * Module:  library/pkparse.c
2511  * Caller:  library/x509_crt.c
2512  *          library/x509_csr.c
2513  *
2514  * Requires: MBEDTLS_PK_C
2515  *
2516  * Uncomment to enable generic public key parse functions.
2517  */
2518 #define MBEDTLS_PK_PARSE_C
2519 
2520 /**
2521  * \def MBEDTLS_PK_WRITE_C
2522  *
2523  * Enable the generic public (asymetric) key writer.
2524  *
2525  * Module:  library/pkwrite.c
2526  * Caller:  library/x509write.c
2527  *
2528  * Requires: MBEDTLS_PK_C
2529  *
2530  * Uncomment to enable generic public key write functions.
2531  */
2532 #define MBEDTLS_PK_WRITE_C
2533 
2534 /**
2535  * \def MBEDTLS_PKCS5_C
2536  *
2537  * Enable PKCS#5 functions.
2538  *
2539  * Module:  library/pkcs5.c
2540  *
2541  * Requires: MBEDTLS_MD_C
2542  *
2543  * This module adds support for the PKCS#5 functions.
2544  */
2545 #define MBEDTLS_PKCS5_C
2546 
2547 /**
2548  * \def MBEDTLS_PKCS12_C
2549  *
2550  * Enable PKCS#12 PBE functions.
2551  * Adds algorithms for parsing PKCS#8 encrypted private keys
2552  *
2553  * Module:  library/pkcs12.c
2554  * Caller:  library/pkparse.c
2555  *
2556  * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
2557  *
2558  * This module enables PKCS#12 functions.
2559  */
2560 #define MBEDTLS_PKCS12_C
2561 
2562 /**
2563  * \def MBEDTLS_PLATFORM_C
2564  *
2565  * Enable the platform abstraction layer that allows you to re-assign
2566  * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
2567  *
2568  * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
2569  * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
2570  * above to be specified at runtime or compile time respectively.
2571  *
2572  * \note This abstraction layer must be enabled on Windows (including MSYS2)
2573  * as other module rely on it for a fixed snprintf implementation.
2574  *
2575  * Module:  library/platform.c
2576  * Caller:  Most other .c files
2577  *
2578  * This module enables abstraction of common (libc) functions.
2579  */
2580 #define MBEDTLS_PLATFORM_C
2581 
2582 /**
2583  * \def MBEDTLS_POLY1305_C
2584  *
2585  * Enable the Poly1305 MAC algorithm.
2586  *
2587  * Module:  library/poly1305.c
2588  * Caller:  library/chachapoly.c
2589  */
2590 #define MBEDTLS_POLY1305_C
2591 
2592 /**
2593  * \def MBEDTLS_PSA_CRYPTO_C
2594  *
2595  * Enable the Platform Security Architecture cryptography API.
2596  *
2597  * \warning The PSA Crypto API is still beta status. While you're welcome to
2598  * experiment using it, incompatible API changes are still possible, and some
2599  * parts may not have reached the same quality as the rest of Mbed TLS yet.
2600  *
2601  * Module:  library/psa_crypto.c
2602  *
2603  * Requires: either MBEDTLS_CTR_DRBG_C and MBEDTLS_ENTROPY_C,
2604  *           or MBEDTLS_HMAC_DRBG_C and MBEDTLS_ENTROPY_C,
2605  *           or MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG.
2606  *
2607  */
2608 #define MBEDTLS_PSA_CRYPTO_C
2609 
2610 /**
2611  * \def MBEDTLS_PSA_CRYPTO_SE_C
2612  *
2613  * Enable secure element support in the Platform Security Architecture
2614  * cryptography API.
2615  *
2616  * \warning This feature is not yet suitable for production. It is provided
2617  *          for API evaluation and testing purposes only.
2618  *
2619  * Module:  library/psa_crypto_se.c
2620  *
2621  * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_CRYPTO_STORAGE_C
2622  *
2623  */
2624 //#define MBEDTLS_PSA_CRYPTO_SE_C
2625 
2626 /**
2627  * \def MBEDTLS_PSA_CRYPTO_STORAGE_C
2628  *
2629  * Enable the Platform Security Architecture persistent key storage.
2630  *
2631  * Module:  library/psa_crypto_storage.c
2632  *
2633  * Requires: MBEDTLS_PSA_CRYPTO_C,
2634  *           either MBEDTLS_PSA_ITS_FILE_C or a native implementation of
2635  *           the PSA ITS interface
2636  */
2637 #define MBEDTLS_PSA_CRYPTO_STORAGE_C
2638 
2639 /**
2640  * \def MBEDTLS_PSA_ITS_FILE_C
2641  *
2642  * Enable the emulation of the Platform Security Architecture
2643  * Internal Trusted Storage (PSA ITS) over files.
2644  *
2645  * Module:  library/psa_its_file.c
2646  *
2647  * Requires: MBEDTLS_FS_IO
2648  */
2649 #define MBEDTLS_PSA_ITS_FILE_C
2650 
2651 /**
2652  * \def MBEDTLS_RIPEMD160_C
2653  *
2654  * Enable the RIPEMD-160 hash algorithm.
2655  *
2656  * Module:  library/ripemd160.c
2657  * Caller:  library/md.c
2658  *
2659  */
2660 #define MBEDTLS_RIPEMD160_C
2661 
2662 /**
2663  * \def MBEDTLS_RSA_C
2664  *
2665  * Enable the RSA public-key cryptosystem.
2666  *
2667  * Module:  library/rsa.c
2668  *          library/rsa_alt_helpers.c
2669  * Caller:  library/ssl_cli.c
2670  *          library/ssl_srv.c
2671  *          library/ssl_tls.c
2672  *          library/x509.c
2673  *
2674  * This module is used by the following key exchanges:
2675  *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
2676  *
2677  * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
2678  */
2679 #define MBEDTLS_RSA_C
2680 
2681 /**
2682  * \def MBEDTLS_SHA1_C
2683  *
2684  * Enable the SHA1 cryptographic hash algorithm.
2685  *
2686  * Module:  library/sha1.c
2687  * Caller:  library/md.c
2688  *          library/ssl_cli.c
2689  *          library/ssl_srv.c
2690  *          library/ssl_tls.c
2691  *          library/x509write_crt.c
2692  *
2693  * This module is required for TLS 1.2 depending on the handshake parameters,
2694  * and for SHA1-signed certificates.
2695  *
2696  * \warning   SHA-1 is considered a weak message digest and its use constitutes
2697  *            a security risk. If possible, we recommend avoiding dependencies
2698  *            on it, and considering stronger message digests instead.
2699  *
2700  */
2701 #define MBEDTLS_SHA1_C
2702 
2703 /**
2704  * \def MBEDTLS_SHA224_C
2705  *
2706  * Enable the SHA-224 cryptographic hash algorithm.
2707  *
2708  * Requires: MBEDTLS_SHA256_C. The library does not currently support enabling
2709  *           SHA-224 without SHA-256.
2710  *
2711  * Module:  library/sha256.c
2712  * Caller:  library/md.c
2713  *          library/ssl_cookie.c
2714  *
2715  * This module adds support for SHA-224.
2716  */
2717 #define MBEDTLS_SHA224_C
2718 
2719 /**
2720  * \def MBEDTLS_SHA256_C
2721  *
2722  * Enable the SHA-256 cryptographic hash algorithm.
2723  *
2724  * Requires: MBEDTLS_SHA224_C. The library does not currently support enabling
2725  *           SHA-256 without SHA-224.
2726  *
2727  * Module:  library/sha256.c
2728  * Caller:  library/entropy.c
2729  *          library/md.c
2730  *          library/ssl_cli.c
2731  *          library/ssl_srv.c
2732  *          library/ssl_tls.c
2733  *
2734  * This module adds support for SHA-256.
2735  * This module is required for the SSL/TLS 1.2 PRF function.
2736  */
2737 #define MBEDTLS_SHA256_C
2738 
2739 /**
2740  * \def MBEDTLS_SHA384_C
2741  *
2742  * Enable the SHA-384 cryptographic hash algorithm.
2743  *
2744  * Requires: MBEDTLS_SHA512_C
2745  *
2746  * Module:  library/sha512.c
2747  * Caller:  library/md.c
2748  *          library/ssl_cli.c
2749  *          library/ssl_srv.c
2750  *
2751  * Comment to disable SHA-384
2752  */
2753 #define MBEDTLS_SHA384_C
2754 
2755 /**
2756  * \def MBEDTLS_SHA512_C
2757  *
2758  * Enable SHA-512 cryptographic hash algorithms.
2759  *
2760  * Module:  library/sha512.c
2761  * Caller:  library/entropy.c
2762  *          library/md.c
2763  *          library/ssl_tls.c
2764  *          library/ssl_cookie.c
2765  *
2766  * This module adds support for SHA-512.
2767  */
2768 #define MBEDTLS_SHA512_C
2769 
2770 /**
2771  * \def MBEDTLS_SSL_CACHE_C
2772  *
2773  * Enable simple SSL cache implementation.
2774  *
2775  * Module:  library/ssl_cache.c
2776  * Caller:
2777  *
2778  * Requires: MBEDTLS_SSL_CACHE_C
2779  */
2780 #define MBEDTLS_SSL_CACHE_C
2781 
2782 /**
2783  * \def MBEDTLS_SSL_COOKIE_C
2784  *
2785  * Enable basic implementation of DTLS cookies for hello verification.
2786  *
2787  * Module:  library/ssl_cookie.c
2788  * Caller:
2789  */
2790 #define MBEDTLS_SSL_COOKIE_C
2791 
2792 /**
2793  * \def MBEDTLS_SSL_TICKET_C
2794  *
2795  * Enable an implementation of TLS server-side callbacks for session tickets.
2796  *
2797  * Module:  library/ssl_ticket.c
2798  * Caller:
2799  *
2800  * Requires: MBEDTLS_CIPHER_C
2801  */
2802 #define MBEDTLS_SSL_TICKET_C
2803 
2804 /**
2805  * \def MBEDTLS_SSL_CLI_C
2806  *
2807  * Enable the SSL/TLS client code.
2808  *
2809  * Module:  library/ssl_cli.c
2810  * Caller:
2811  *
2812  * Requires: MBEDTLS_SSL_TLS_C
2813  *
2814  * This module is required for SSL/TLS client support.
2815  */
2816 #define MBEDTLS_SSL_CLI_C
2817 
2818 /**
2819  * \def MBEDTLS_SSL_SRV_C
2820  *
2821  * Enable the SSL/TLS server code.
2822  *
2823  * Module:  library/ssl_srv.c
2824  * Caller:
2825  *
2826  * Requires: MBEDTLS_SSL_TLS_C
2827  *
2828  * This module is required for SSL/TLS server support.
2829  */
2830 #define MBEDTLS_SSL_SRV_C
2831 
2832 /**
2833  * \def MBEDTLS_SSL_TLS_C
2834  *
2835  * Enable the generic SSL/TLS code.
2836  *
2837  * Module:  library/ssl_tls.c
2838  * Caller:  library/ssl_cli.c
2839  *          library/ssl_srv.c
2840  *
2841  * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
2842  *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
2843  *
2844  * This module is required for SSL/TLS.
2845  */
2846 #define MBEDTLS_SSL_TLS_C
2847 
2848 /**
2849  * \def MBEDTLS_THREADING_C
2850  *
2851  * Enable the threading abstraction layer.
2852  * By default mbed TLS assumes it is used in a non-threaded environment or that
2853  * contexts are not shared between threads. If you do intend to use contexts
2854  * between threads, you will need to enable this layer to prevent race
2855  * conditions. See also our Knowledge Base article about threading:
2856  * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
2857  *
2858  * Module:  library/threading.c
2859  *
2860  * This allows different threading implementations (self-implemented or
2861  * provided).
2862  *
2863  * You will have to enable either MBEDTLS_THREADING_ALT or
2864  * MBEDTLS_THREADING_PTHREAD.
2865  *
2866  * Enable this layer to allow use of mutexes within mbed TLS
2867  */
2868 //#define MBEDTLS_THREADING_C
2869 
2870 /**
2871  * \def MBEDTLS_TIMING_C
2872  *
2873  * Enable the semi-portable timing interface.
2874  *
2875  * \note The provided implementation only works on POSIX/Unix (including Linux,
2876  * BSD and OS X) and Windows. On other platforms, you can either disable that
2877  * module and provide your own implementations of the callbacks needed by
2878  * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide
2879  * your own implementation of the whole module by setting
2880  * \c MBEDTLS_TIMING_ALT in the current file.
2881  *
2882  * \note See also our Knowledge Base article about porting to a new
2883  * environment:
2884  * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
2885  *
2886  * Module:  library/timing.c
2887  */
2888 #define MBEDTLS_TIMING_C
2889 
2890 /**
2891  * \def MBEDTLS_VERSION_C
2892  *
2893  * Enable run-time version information.
2894  *
2895  * Module:  library/version.c
2896  *
2897  * This module provides run-time version information.
2898  */
2899 #define MBEDTLS_VERSION_C
2900 
2901 /**
2902  * \def MBEDTLS_X509_USE_C
2903  *
2904  * Enable X.509 core for using certificates.
2905  *
2906  * Module:  library/x509.c
2907  * Caller:  library/x509_crl.c
2908  *          library/x509_crt.c
2909  *          library/x509_csr.c
2910  *
2911  * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
2912  *           MBEDTLS_PK_PARSE_C
2913  *
2914  * This module is required for the X.509 parsing modules.
2915  */
2916 #define MBEDTLS_X509_USE_C
2917 
2918 /**
2919  * \def MBEDTLS_X509_CRT_PARSE_C
2920  *
2921  * Enable X.509 certificate parsing.
2922  *
2923  * Module:  library/x509_crt.c
2924  * Caller:  library/ssl_cli.c
2925  *          library/ssl_srv.c
2926  *          library/ssl_tls.c
2927  *
2928  * Requires: MBEDTLS_X509_USE_C
2929  *
2930  * This module is required for X.509 certificate parsing.
2931  */
2932 #define MBEDTLS_X509_CRT_PARSE_C
2933 
2934 /**
2935  * \def MBEDTLS_X509_CRL_PARSE_C
2936  *
2937  * Enable X.509 CRL parsing.
2938  *
2939  * Module:  library/x509_crl.c
2940  * Caller:  library/x509_crt.c
2941  *
2942  * Requires: MBEDTLS_X509_USE_C
2943  *
2944  * This module is required for X.509 CRL parsing.
2945  */
2946 #define MBEDTLS_X509_CRL_PARSE_C
2947 
2948 /**
2949  * \def MBEDTLS_X509_CSR_PARSE_C
2950  *
2951  * Enable X.509 Certificate Signing Request (CSR) parsing.
2952  *
2953  * Module:  library/x509_csr.c
2954  * Caller:  library/x509_crt_write.c
2955  *
2956  * Requires: MBEDTLS_X509_USE_C
2957  *
2958  * This module is used for reading X.509 certificate request.
2959  */
2960 #define MBEDTLS_X509_CSR_PARSE_C
2961 
2962 /**
2963  * \def MBEDTLS_X509_CREATE_C
2964  *
2965  * Enable X.509 core for creating certificates.
2966  *
2967  * Module:  library/x509_create.c
2968  *
2969  * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C
2970  *
2971  * This module is the basis for creating X.509 certificates and CSRs.
2972  */
2973 #define MBEDTLS_X509_CREATE_C
2974 
2975 /**
2976  * \def MBEDTLS_X509_CRT_WRITE_C
2977  *
2978  * Enable creating X.509 certificates.
2979  *
2980  * Module:  library/x509_crt_write.c
2981  *
2982  * Requires: MBEDTLS_X509_CREATE_C
2983  *
2984  * This module is required for X.509 certificate creation.
2985  */
2986 #define MBEDTLS_X509_CRT_WRITE_C
2987 
2988 /**
2989  * \def MBEDTLS_X509_CSR_WRITE_C
2990  *
2991  * Enable creating X.509 Certificate Signing Requests (CSR).
2992  *
2993  * Module:  library/x509_csr_write.c
2994  *
2995  * Requires: MBEDTLS_X509_CREATE_C
2996  *
2997  * This module is required for X.509 certificate request writing.
2998  */
2999 #define MBEDTLS_X509_CSR_WRITE_C
3000 
3001 /* \} name SECTION: mbed TLS modules */
3002 
3003 /**
3004  * \name SECTION: Module configuration options
3005  *
3006  * This section allows for the setting of module specific sizes and
3007  * configuration options. The default values are already present in the
3008  * relevant header files and should suffice for the regular use cases.
3009  *
3010  * Our advice is to enable options and change their values here
3011  * only if you have a good reason and know the consequences.
3012  *
3013  * Please check the respective header file for documentation on these
3014  * parameters (to prevent duplicate documentation).
3015  * \{
3016  */
3017 
3018 /* MPI / BIGNUM options */
3019 //#define MBEDTLS_MPI_WINDOW_SIZE            6 /**< Maximum window size used. */
3020 //#define MBEDTLS_MPI_MAX_SIZE            1024 /**< Maximum number of bytes for usable MPIs. */
3021 
3022 /* CTR_DRBG options */
3023 //#define MBEDTLS_CTR_DRBG_ENTROPY_LEN               48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
3024 //#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL        10000 /**< Interval before reseed is performed by default */
3025 //#define MBEDTLS_CTR_DRBG_MAX_INPUT                256 /**< Maximum number of additional input bytes */
3026 //#define MBEDTLS_CTR_DRBG_MAX_REQUEST             1024 /**< Maximum number of requested bytes per call */
3027 //#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT           384 /**< Maximum size of (re)seed buffer */
3028 
3029 /* HMAC_DRBG options */
3030 //#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL   10000 /**< Interval before reseed is performed by default */
3031 //#define MBEDTLS_HMAC_DRBG_MAX_INPUT           256 /**< Maximum number of additional input bytes */
3032 //#define MBEDTLS_HMAC_DRBG_MAX_REQUEST        1024 /**< Maximum number of requested bytes per call */
3033 //#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT      384 /**< Maximum size of (re)seed buffer */
3034 
3035 /* ECP options */
3036 //#define MBEDTLS_ECP_WINDOW_SIZE            4 /**< Maximum window size used */
3037 //#define MBEDTLS_ECP_FIXED_POINT_OPTIM      1 /**< Enable fixed-point speed-up */
3038 
3039 /* Entropy options */
3040 //#define MBEDTLS_ENTROPY_MAX_SOURCES                20 /**< Maximum number of sources supported */
3041 //#define MBEDTLS_ENTROPY_MAX_GATHER                128 /**< Maximum amount requested from entropy sources */
3042 //#define MBEDTLS_ENTROPY_MIN_HARDWARE               32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
3043 
3044 /* Memory buffer allocator options */
3045 //#define MBEDTLS_MEMORY_ALIGN_MULTIPLE      4 /**< Align on multiples of this value */
3046 
3047 /* Platform options */
3048 //#define MBEDTLS_PLATFORM_STD_MEM_HDR   <stdlib.h> /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
3049 //#define MBEDTLS_PLATFORM_STD_CALLOC        calloc /**< Default allocator to use, can be undefined */
3050 //#define MBEDTLS_PLATFORM_STD_FREE            free /**< Default free to use, can be undefined */
3051 //#define MBEDTLS_PLATFORM_STD_EXIT            exit /**< Default exit to use, can be undefined */
3052 //#define MBEDTLS_PLATFORM_STD_TIME            time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
3053 //#define MBEDTLS_PLATFORM_STD_FPRINTF      fprintf /**< Default fprintf to use, can be undefined */
3054 //#define MBEDTLS_PLATFORM_STD_PRINTF        printf /**< Default printf to use, can be undefined */
3055 /* Note: your snprintf must correctly zero-terminate the buffer! */
3056 //#define MBEDTLS_PLATFORM_STD_SNPRINTF    snprintf /**< Default snprintf to use, can be undefined */
3057 //#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS       0 /**< Default exit value to use, can be undefined */
3058 //#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE       1 /**< Default exit value to use, can be undefined */
3059 //#define MBEDTLS_PLATFORM_STD_NV_SEED_READ   mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
3060 //#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE  mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
3061 //#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE  "seedfile" /**< Seed file to read/write with default implementation */
3062 
3063 /* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
3064 /* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
3065 //#define MBEDTLS_PLATFORM_CALLOC_MACRO        calloc /**< Default allocator macro to use, can be undefined */
3066 //#define MBEDTLS_PLATFORM_FREE_MACRO            free /**< Default free macro to use, can be undefined */
3067 //#define MBEDTLS_PLATFORM_EXIT_MACRO            exit /**< Default exit macro to use, can be undefined */
3068 //#define MBEDTLS_PLATFORM_TIME_MACRO            time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
3069 //#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO       time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
3070 //#define MBEDTLS_PLATFORM_FPRINTF_MACRO      fprintf /**< Default fprintf macro to use, can be undefined */
3071 #define MBEDTLS_PLATFORM_PRINTF_MACRO        ets_printf /**< Default printf macro to use, can be undefined */
3072 /* Note: your snprintf must correctly zero-terminate the buffer! */
3073 //#define MBEDTLS_PLATFORM_SNPRINTF_MACRO    snprintf /**< Default snprintf macro to use, can be undefined */
3074 //#define MBEDTLS_PLATFORM_VSNPRINTF_MACRO    vsnprintf /**< Default vsnprintf macro to use, can be undefined */
3075 //#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO   mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
3076 //#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO  mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
3077 
3078 /* PSA options */
3079 /**
3080  * Use HMAC_DRBG with the specified hash algorithm for HMAC_DRBG for the
3081  * PSA crypto subsystem.
3082  *
3083  * If this option is unset:
3084  * - If CTR_DRBG is available, the PSA subsystem uses it rather than HMAC_DRBG.
3085  * - Otherwise, the PSA subsystem uses HMAC_DRBG with either
3086  *   #MBEDTLS_MD_SHA512 or #MBEDTLS_MD_SHA256 based on availability and
3087  *   on unspecified heuristics.
3088  */
3089 //#define MBEDTLS_PSA_HMAC_DRBG_MD_TYPE MBEDTLS_MD_SHA256
3090 
3091 /** \def MBEDTLS_PSA_KEY_SLOT_COUNT
3092  * Restrict the PSA library to supporting a maximum amount of simultaneously
3093  * loaded keys. A loaded key is a key stored by the PSA Crypto core as a
3094  * volatile key, or a persistent key which is loaded temporarily by the
3095  * library as part of a crypto operation in flight.
3096  *
3097  * If this option is unset, the library will fall back to a default value of
3098  * 32 keys.
3099  */
3100 //#define MBEDTLS_PSA_KEY_SLOT_COUNT 32
3101 
3102 /* SSL Cache options */
3103 //#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT       86400 /**< 1 day  */
3104 //#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES      50 /**< Maximum entries in cache */
3105 
3106 /* SSL options */
3107 
3108 /** \def MBEDTLS_SSL_IN_CONTENT_LEN
3109  *
3110  * Maximum length (in bytes) of incoming plaintext fragments.
3111  *
3112  * This determines the size of the incoming TLS I/O buffer in such a way
3113  * that it is capable of holding the specified amount of plaintext data,
3114  * regardless of the protection mechanism used.
3115  *
3116  * \note When using a value less than the default of 16KB on the client, it is
3117  *       recommended to use the Maximum Fragment Length (MFL) extension to
3118  *       inform the server about this limitation. On the server, there
3119  *       is no supported, standardized way of informing the client about
3120  *       restriction on the maximum size of incoming messages, and unless
3121  *       the limitation has been communicated by other means, it is recommended
3122  *       to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
3123  *       while keeping the default value of 16KB for the incoming buffer.
3124  *
3125  * Uncomment to set the maximum plaintext size of the incoming I/O buffer.
3126  */
3127 //#define MBEDTLS_SSL_IN_CONTENT_LEN              16384
3128 
3129 /** \def MBEDTLS_SSL_CID_IN_LEN_MAX
3130  *
3131  * The maximum length of CIDs used for incoming DTLS messages.
3132  *
3133  */
3134 //#define MBEDTLS_SSL_CID_IN_LEN_MAX 32
3135 
3136 /** \def MBEDTLS_SSL_CID_OUT_LEN_MAX
3137  *
3138  * The maximum length of CIDs used for outgoing DTLS messages.
3139  *
3140  */
3141 //#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32
3142 
3143 /** \def MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY
3144  *
3145  * This option controls the use of record plaintext padding
3146  * in TLS 1.3 and when using the Connection ID extension in DTLS 1.2.
3147  *
3148  * The padding will always be chosen so that the length of the
3149  * padded plaintext is a multiple of the value of this option.
3150  *
3151  * Note: A value of \c 1 means that no padding will be used
3152  *       for outgoing records.
3153  *
3154  * Note: On systems lacking division instructions,
3155  *       a power of two should be preferred.
3156  */
3157 //#define MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 16
3158 
3159 /** \def MBEDTLS_SSL_OUT_CONTENT_LEN
3160  *
3161  * Maximum length (in bytes) of outgoing plaintext fragments.
3162  *
3163  * This determines the size of the outgoing TLS I/O buffer in such a way
3164  * that it is capable of holding the specified amount of plaintext data,
3165  * regardless of the protection mechanism used.
3166  *
3167  * It is possible to save RAM by setting a smaller outward buffer, while keeping
3168  * the default inward 16384 byte buffer to conform to the TLS specification.
3169  *
3170  * The minimum required outward buffer size is determined by the handshake
3171  * protocol's usage. Handshaking will fail if the outward buffer is too small.
3172  * The specific size requirement depends on the configured ciphers and any
3173  * certificate data which is sent during the handshake.
3174  *
3175  * Uncomment to set the maximum plaintext size of the outgoing I/O buffer.
3176  */
3177 //#define MBEDTLS_SSL_OUT_CONTENT_LEN             16384
3178 
3179 /** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
3180  *
3181  * Maximum number of heap-allocated bytes for the purpose of
3182  * DTLS handshake message reassembly and future message buffering.
3183  *
3184  * This should be at least 9/8 * MBEDTLSSL_IN_CONTENT_LEN
3185  * to account for a reassembled handshake message of maximum size,
3186  * together with its reassembly bitmap.
3187  *
3188  * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
3189  * should be sufficient for all practical situations as it allows
3190  * to reassembly a large handshake message (such as a certificate)
3191  * while buffering multiple smaller handshake messages.
3192  *
3193  */
3194 //#define MBEDTLS_SSL_DTLS_MAX_BUFFERING             32768
3195 
3196 //#define MBEDTLS_PSK_MAX_LEN               32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
3197 //#define MBEDTLS_SSL_COOKIE_TIMEOUT        60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
3198 
3199 /**
3200  * Complete list of ciphersuites to use, in order of preference.
3201  *
3202  * \warning No dependency checking is done on that field! This option can only
3203  * be used to restrict the set of available ciphersuites. It is your
3204  * responsibility to make sure the needed modules are active.
3205  *
3206  * Use this to save a few hundred bytes of ROM (default ordering of all
3207  * available ciphersuites) and a few to a few hundred bytes of RAM.
3208  *
3209  * The value below is only an example, not the default.
3210  */
3211 //#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
3212 
3213 /* X509 options */
3214 //#define MBEDTLS_X509_MAX_INTERMEDIATE_CA   8   /**< Maximum number of intermediate CAs in a verification chain. */
3215 //#define MBEDTLS_X509_MAX_FILE_PATH_LEN     512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
3216 
3217 /**
3218  * Uncomment the macro to let mbed TLS use your alternate implementation of
3219  * mbedtls_platform_zeroize(). This replaces the default implementation in
3220  * platform_util.c.
3221  *
3222  * mbedtls_platform_zeroize() is a widely used function across the library to
3223  * zero a block of memory. The implementation is expected to be secure in the
3224  * sense that it has been written to prevent the compiler from removing calls
3225  * to mbedtls_platform_zeroize() as part of redundant code elimination
3226  * optimizations. However, it is difficult to guarantee that calls to
3227  * mbedtls_platform_zeroize() will not be optimized by the compiler as older
3228  * versions of the C language standards do not provide a secure implementation
3229  * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to
3230  * configure their own implementation of mbedtls_platform_zeroize(), for
3231  * example by using directives specific to their compiler, features from newer
3232  * C standards (e.g using memset_s() in C11) or calling a secure memset() from
3233  * their system (e.g explicit_bzero() in BSD).
3234  */
3235 //#define MBEDTLS_PLATFORM_ZEROIZE_ALT
3236 
3237 /**
3238  * Uncomment the macro to let Mbed TLS use your alternate implementation of
3239  * mbedtls_platform_gmtime_r(). This replaces the default implementation in
3240  * platform_util.c.
3241  *
3242  * gmtime() is not a thread-safe function as defined in the C standard. The
3243  * library will try to use safer implementations of this function, such as
3244  * gmtime_r() when available. However, if Mbed TLS cannot identify the target
3245  * system, the implementation of mbedtls_platform_gmtime_r() will default to
3246  * using the standard gmtime(). In this case, calls from the library to
3247  * gmtime() will be guarded by the global mutex mbedtls_threading_gmtime_mutex
3248  * if MBEDTLS_THREADING_C is enabled. We recommend that calls from outside the
3249  * library are also guarded with this mutex to avoid race conditions. However,
3250  * if the macro MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will
3251  * unconditionally use the implementation for mbedtls_platform_gmtime_r()
3252  * supplied at compile time.
3253  */
3254 //#define MBEDTLS_PLATFORM_GMTIME_R_ALT
3255 
3256 /**
3257  * Enable the verified implementations of ECDH primitives from Project Everest
3258  * (currently only Curve25519). This feature changes the layout of ECDH
3259  * contexts and therefore is a compatibility break for applications that access
3260  * fields of a mbedtls_ecdh_context structure directly. See also
3261  * MBEDTLS_ECDH_LEGACY_CONTEXT in include/mbedtls/ecdh.h.
3262  */
3263 //#define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED
3264 
3265 /* \} name SECTION: Customisation configuration options */
3266