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