blob: f3a8b722f8c1c3ea43c4f3e6771211b9d3626e11 [file] [log] [blame]
Gilles Peskined8374ba2018-02-16 20:36:55 +01001/**
2 * \file config-psa-crypto.h
3 *
4 * \brief Configuration with all cryptography features and no X.509 or TLS.
5 *
6 * This configuration is intended to prototype the PSA reference implementation.
7 */
8/*
9 * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
10 * SPDX-License-Identifier: Apache-2.0
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License"); you may
13 * not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
20 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 * This file is part of mbed TLS (https://tls.mbed.org)
25 */
26
27#ifndef MBEDTLS_CONFIG_H
28#define MBEDTLS_CONFIG_H
29
30#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
31#define _CRT_SECURE_NO_DEPRECATE 1
32#endif
33
34/**
35 * \name SECTION: System support
36 *
37 * This section sets system specific settings.
38 * \{
39 */
40
41/**
42 * \def MBEDTLS_HAVE_ASM
43 *
44 * The compiler has support for asm().
45 *
46 * Requires support for asm() in compiler.
47 *
48 * Used in:
49 * library/timing.c
50 * library/padlock.c
51 * include/mbedtls/bn_mul.h
52 *
53 * Comment to disable the use of assembly code.
54 */
55#define MBEDTLS_HAVE_ASM
56
57/**
58 * \def MBEDTLS_NO_UDBL_DIVISION
59 *
60 * The platform lacks support for double-width integer division (64-bit
61 * division on a 32-bit platform, 128-bit division on a 64-bit platform).
62 *
63 * Used in:
64 * include/mbedtls/bignum.h
65 * library/bignum.c
66 *
67 * The bignum code uses double-width division to speed up some operations.
68 * Double-width division is often implemented in software that needs to
69 * be linked with the program. The presence of a double-width integer
70 * type is usually detected automatically through preprocessor macros,
71 * but the automatic detection cannot know whether the code needs to
72 * and can be linked with an implementation of division for that type.
73 * By default division is assumed to be usable if the type is present.
74 * Uncomment this option to prevent the use of double-width division.
75 *
76 * Note that division for the native integer type is always required.
77 * Furthermore, a 64-bit type is always required even on a 32-bit
78 * platform, but it need not support multiplication or division. In some
79 * cases it is also desirable to disable some double-width operations. For
80 * example, if double-width division is implemented in software, disabling
81 * it can reduce code size in some embedded targets.
82 */
83//#define MBEDTLS_NO_UDBL_DIVISION
84
85/**
86 * \def MBEDTLS_HAVE_SSE2
87 *
88 * CPU supports SSE2 instruction set.
89 *
90 * Uncomment if the CPU supports SSE2 (IA-32 specific).
91 */
92//#define MBEDTLS_HAVE_SSE2
93
94/**
95 * \def MBEDTLS_PLATFORM_MEMORY
96 *
97 * Enable the memory allocation layer.
98 *
99 * By default mbed TLS uses the system-provided calloc() and free().
100 * This allows different allocators (self-implemented or provided) to be
101 * provided to the platform abstraction layer.
102 *
103 * Enabling MBEDTLS_PLATFORM_MEMORY without the
104 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
105 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
106 * free() function pointer at runtime.
107 *
108 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
109 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
110 * alternate function at compile time.
111 *
112 * Requires: MBEDTLS_PLATFORM_C
113 *
114 * Enable this layer to allow use of alternative memory allocators.
115 */
116//#define MBEDTLS_PLATFORM_MEMORY
117
118/**
119 * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
120 *
121 * Do not assign standard functions in the platform layer (e.g. calloc() to
122 * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
123 *
124 * This makes sure there are no linking errors on platforms that do not support
125 * these functions. You will HAVE to provide alternatives, either at runtime
126 * via the platform_set_xxx() functions or at compile time by setting
127 * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
128 * MBEDTLS_PLATFORM_XXX_MACRO.
129 *
130 * Requires: MBEDTLS_PLATFORM_C
131 *
132 * Uncomment to prevent default assignment of standard functions in the
133 * platform layer.
134 */
135//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
136
137/**
138 * \def MBEDTLS_PLATFORM_EXIT_ALT
139 *
140 * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the
141 * function in the platform abstraction layer.
142 *
143 * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will
144 * provide a function "mbedtls_platform_set_printf()" that allows you to set an
145 * alternative printf function pointer.
146 *
147 * All these define require MBEDTLS_PLATFORM_C to be defined!
148 *
149 * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
150 * it will be enabled automatically by check_config.h
151 *
152 * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
153 * MBEDTLS_PLATFORM_XXX_MACRO!
154 *
Gilles Peskined8374ba2018-02-16 20:36:55 +0100155 * Uncomment a macro to enable alternate implementation of specific base
156 * platform function
157 */
158//#define MBEDTLS_PLATFORM_EXIT_ALT
Gilles Peskined8374ba2018-02-16 20:36:55 +0100159//#define MBEDTLS_PLATFORM_FPRINTF_ALT
160//#define MBEDTLS_PLATFORM_PRINTF_ALT
161//#define MBEDTLS_PLATFORM_SNPRINTF_ALT
162//#define MBEDTLS_PLATFORM_NV_SEED_ALT
163//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
164
165/**
166 * \def MBEDTLS_DEPRECATED_WARNING
167 *
168 * Mark deprecated functions so that they generate a warning if used.
169 * Functions deprecated in one version will usually be removed in the next
170 * version. You can enable this to help you prepare the transition to a new
171 * major version by making sure your code is not using these functions.
172 *
173 * This only works with GCC and Clang. With other compilers, you may want to
174 * use MBEDTLS_DEPRECATED_REMOVED
175 *
176 * Uncomment to get warnings on using deprecated functions.
177 */
178//#define MBEDTLS_DEPRECATED_WARNING
179
180/**
181 * \def MBEDTLS_DEPRECATED_REMOVED
182 *
183 * Remove deprecated functions so that they generate an error if used.
184 * Functions deprecated in one version will usually be removed in the next
185 * version. You can enable this to help you prepare the transition to a new
186 * major version by making sure your code is not using these functions.
187 *
188 * Uncomment to get errors on using deprecated functions.
189 */
190//#define MBEDTLS_DEPRECATED_REMOVED
191
192/* \} name SECTION: System support */
193
194/**
195 * \name SECTION: mbed TLS feature support
196 *
197 * This section sets support for features that are or are not needed
198 * within the modules that are enabled.
199 * \{
200 */
201
202/**
203 * \def MBEDTLS_AES_ALT
204 *
205 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
206 * alternate core implementation of a symmetric crypto, an arithmetic or hash
207 * module (e.g. platform specific assembly optimized implementations). Keep
208 * in mind that the function prototypes should remain the same.
209 *
210 * This replaces the whole module. If you only want to replace one of the
211 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
212 *
213 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
214 * provide the "struct mbedtls_aes_context" definition and omit the base
215 * function declarations and implementations. "aes_alt.h" will be included from
216 * "aes.h" to include the new function definitions.
217 *
218 * Uncomment a macro to enable alternate implementation of the corresponding
219 * module.
220 *
221 * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
222 * use constitutes a security risk. If possible, we recommend
223 * avoiding dependencies on them, and considering stronger message
224 * digests and ciphers instead.
225 *
226 */
227//#define MBEDTLS_AES_ALT
228//#define MBEDTLS_ARC4_ALT
229//#define MBEDTLS_BLOWFISH_ALT
230//#define MBEDTLS_CAMELLIA_ALT
231//#define MBEDTLS_CCM_ALT
232//#define MBEDTLS_CMAC_ALT
233//#define MBEDTLS_DES_ALT
234//#define MBEDTLS_DHM_ALT
235//#define MBEDTLS_ECJPAKE_ALT
236//#define MBEDTLS_GCM_ALT
237//#define MBEDTLS_MD2_ALT
238//#define MBEDTLS_MD4_ALT
239//#define MBEDTLS_MD5_ALT
240//#define MBEDTLS_RIPEMD160_ALT
241//#define MBEDTLS_RSA_ALT
242//#define MBEDTLS_SHA1_ALT
243//#define MBEDTLS_SHA256_ALT
244//#define MBEDTLS_SHA512_ALT
245//#define MBEDTLS_XTEA_ALT
246/*
247 * When replacing the elliptic curve module, pleace consider, that it is
248 * implemented with two .c files:
249 * - ecp.c
250 * - ecp_curves.c
251 * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT
252 * macros as described above. The only difference is that you have to make sure
253 * that you provide functionality for both .c files.
254 */
255//#define MBEDTLS_ECP_ALT
256
257/**
258 * \def MBEDTLS_MD2_PROCESS_ALT
259 *
260 * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you
261 * alternate core implementation of symmetric crypto or hash function. Keep in
262 * mind that function prototypes should remain the same.
263 *
264 * This replaces only one function. The header file from mbed TLS is still
265 * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags.
266 *
267 * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will
268 * no longer provide the mbedtls_sha1_process() function, but it will still provide
269 * the other function (using your mbedtls_sha1_process() function) and the definition
270 * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible
271 * with this definition.
272 *
273 * \note Because of a signature change, the core AES encryption and decryption routines are
274 * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt,
275 * respectively. When setting up alternative implementations, these functions should
276 * be overriden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt
277 * must stay untouched.
278 *
279 * \note If you use the AES_xxx_ALT macros, then is is recommended to also set
280 * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
281 * tables.
282 *
283 * Uncomment a macro to enable alternate implementation of the corresponding
284 * function.
285 *
286 * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use
287 * constitutes a security risk. If possible, we recommend avoiding
288 * dependencies on them, and considering stronger message digests
289 * and ciphers instead.
290 *
291 */
292//#define MBEDTLS_MD2_PROCESS_ALT
293//#define MBEDTLS_MD4_PROCESS_ALT
294//#define MBEDTLS_MD5_PROCESS_ALT
295//#define MBEDTLS_RIPEMD160_PROCESS_ALT
296//#define MBEDTLS_SHA1_PROCESS_ALT
297//#define MBEDTLS_SHA256_PROCESS_ALT
298//#define MBEDTLS_SHA512_PROCESS_ALT
299//#define MBEDTLS_DES_SETKEY_ALT
300//#define MBEDTLS_DES_CRYPT_ECB_ALT
301//#define MBEDTLS_DES3_CRYPT_ECB_ALT
302//#define MBEDTLS_AES_SETKEY_ENC_ALT
303//#define MBEDTLS_AES_SETKEY_DEC_ALT
304//#define MBEDTLS_AES_ENCRYPT_ALT
305//#define MBEDTLS_AES_DECRYPT_ALT
306//#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
307//#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT
308//#define MBEDTLS_ECDSA_VERIFY_ALT
309//#define MBEDTLS_ECDSA_SIGN_ALT
310//#define MBEDTLS_ECDSA_GENKEY_ALT
311
312/**
313 * \def MBEDTLS_ECP_INTERNAL_ALT
314 *
315 * Expose a part of the internal interface of the Elliptic Curve Point module.
316 *
317 * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your
318 * alternative core implementation of elliptic curve arithmetic. Keep in mind
319 * that function prototypes should remain the same.
320 *
321 * This partially replaces one function. The header file from mbed TLS is still
322 * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation
323 * is still present and it is used for group structures not supported by the
324 * alternative.
325 *
326 * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT
327 * and implementing the following functions:
328 * unsigned char mbedtls_internal_ecp_grp_capable(
329 * const mbedtls_ecp_group *grp )
330 * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp )
331 * void mbedtls_internal_ecp_deinit( const mbedtls_ecp_group *grp )
332 * The mbedtls_internal_ecp_grp_capable function should return 1 if the
333 * replacement functions implement arithmetic for the given group and 0
334 * otherwise.
335 * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_deinit are
336 * called before and after each point operation and provide an opportunity to
337 * implement optimized set up and tear down instructions.
338 *
339 * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and
340 * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac
341 * function, but will use your mbedtls_internal_ecp_double_jac if the group is
342 * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when
343 * receives it as an argument). If the group is not supported then the original
344 * implementation is used. The other functions and the definition of
345 * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your
346 * implementation of mbedtls_internal_ecp_double_jac and
347 * mbedtls_internal_ecp_grp_capable must be compatible with this definition.
348 *
349 * Uncomment a macro to enable alternate implementation of the corresponding
350 * function.
351 */
352/* Required for all the functions in this section */
353//#define MBEDTLS_ECP_INTERNAL_ALT
354/* Support for Weierstrass curves with Jacobi representation */
355//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
356//#define MBEDTLS_ECP_ADD_MIXED_ALT
357//#define MBEDTLS_ECP_DOUBLE_JAC_ALT
358//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
359//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
360/* Support for curves with Montgomery arithmetic */
361//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
362//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
363//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
364
365/**
366 * \def MBEDTLS_TEST_NULL_ENTROPY
367 *
368 * Enables testing and use of mbed TLS without any configured entropy sources.
369 * This permits use of the library on platforms before an entropy source has
370 * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the
371 * MBEDTLS_ENTROPY_NV_SEED switches).
372 *
373 * WARNING! This switch MUST be disabled in production builds, and is suitable
374 * only for development.
375 * Enabling the switch negates any security provided by the library.
376 *
377 * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
378 *
379 */
380//#define MBEDTLS_TEST_NULL_ENTROPY
381
382/**
383 * \def MBEDTLS_ENTROPY_HARDWARE_ALT
384 *
385 * Uncomment this macro to let mbed TLS use your own implementation of a
386 * hardware entropy collector.
387 *
388 * Your function must be called \c mbedtls_hardware_poll(), have the same
389 * prototype as declared in entropy_poll.h, and accept NULL as first argument.
390 *
391 * Uncomment to use your own hardware entropy collector.
392 */
393//#define MBEDTLS_ENTROPY_HARDWARE_ALT
394
395/**
396 * \def MBEDTLS_AES_ROM_TABLES
397 *
Gilles Peskine13187932018-06-19 11:49:23 +0200398 * Use precomputed AES tables stored in ROM.
Gilles Peskined8374ba2018-02-16 20:36:55 +0100399 *
Gilles Peskine13187932018-06-19 11:49:23 +0200400 * Uncomment this macro to use precomputed AES tables stored in ROM.
401 * Comment this macro to generate AES tables in RAM at runtime.
402 *
403 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
404 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
405 * initialization time before the first AES operation can be performed.
406 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
407 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
408 * performance if ROM access is slower than RAM access.
409 *
410 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
411 *
Gilles Peskined8374ba2018-02-16 20:36:55 +0100412 */
413//#define MBEDTLS_AES_ROM_TABLES
414
415/**
Gilles Peskine13187932018-06-19 11:49:23 +0200416 * \def MBEDTLS_AES_FEWER_TABLES
417 *
418 * Use less ROM/RAM for AES tables.
419 *
420 * Uncommenting this macro omits 75% of the AES tables from
421 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
422 * by computing their values on the fly during operations
423 * (the tables are entry-wise rotations of one another).
424 *
425 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
426 * by ~6kb but at the cost of more arithmetic operations during
427 * runtime. Specifically, one has to compare 4 accesses within
428 * different tables to 4 accesses with additional arithmetic
429 * operations within the same table. The performance gain/loss
430 * depends on the system and memory details.
431 *
432 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
433 *
434 */
435//#define MBEDTLS_AES_FEWER_TABLES
436
437/**
Gilles Peskined8374ba2018-02-16 20:36:55 +0100438 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
439 *
440 * Use less ROM for the Camellia implementation (saves about 768 bytes).
441 *
442 * Uncomment this macro to use less memory for Camellia.
443 */
444//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
445
446/**
447 * \def MBEDTLS_CIPHER_MODE_CBC
448 *
449 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
450 */
451#define MBEDTLS_CIPHER_MODE_CBC
452
453/**
454 * \def MBEDTLS_CIPHER_MODE_CFB
455 *
456 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
457 */
458#define MBEDTLS_CIPHER_MODE_CFB
459
460/**
461 * \def MBEDTLS_CIPHER_MODE_CTR
462 *
463 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
464 */
465#define MBEDTLS_CIPHER_MODE_CTR
466
467/**
468 * \def MBEDTLS_CIPHER_PADDING_PKCS7
469 *
470 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
471 * specific padding modes in the cipher layer with cipher modes that support
472 * padding (e.g. CBC)
473 *
474 * If you disable all padding modes, only full blocks can be used with CBC.
475 *
476 * Enable padding modes in the cipher layer.
477 */
478#define MBEDTLS_CIPHER_PADDING_PKCS7
479#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
480#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
481#define MBEDTLS_CIPHER_PADDING_ZEROS
482
483/**
484 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
485 *
486 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
487 * module. By default all supported curves are enabled.
488 *
489 * Comment macros to disable the curve and functions for it
490 */
491#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
492#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
493#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
494#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
495#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
496#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
497#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
498#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
499#define MBEDTLS_ECP_DP_BP256R1_ENABLED
500#define MBEDTLS_ECP_DP_BP384R1_ENABLED
501#define MBEDTLS_ECP_DP_BP512R1_ENABLED
502#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
Gilles Peskine13187932018-06-19 11:49:23 +0200503#define MBEDTLS_ECP_DP_CURVE448_ENABLED
Gilles Peskined8374ba2018-02-16 20:36:55 +0100504
505/**
506 * \def MBEDTLS_ECP_NIST_OPTIM
507 *
508 * Enable specific 'modulo p' routines for each NIST prime.
509 * Depending on the prime and architecture, makes operations 4 to 8 times
510 * faster on the corresponding curve.
511 *
512 * Comment this macro to disable NIST curves optimisation.
513 */
514#define MBEDTLS_ECP_NIST_OPTIM
515
516/**
517 * \def MBEDTLS_ECDSA_DETERMINISTIC
518 *
519 * Enable deterministic ECDSA (RFC 6979).
520 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
521 * may result in a compromise of the long-term signing key. This is avoided by
522 * the deterministic variant.
523 *
524 * Requires: MBEDTLS_HMAC_DRBG_C
525 *
526 * Comment this macro to disable deterministic ECDSA.
527 */
528#define MBEDTLS_ECDSA_DETERMINISTIC
529
530/**
531 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
532 *
533 * Enhance support for reading EC keys using variants of SEC1 not allowed by
534 * RFC 5915 and RFC 5480.
535 *
536 * Currently this means parsing the SpecifiedECDomain choice of EC
537 * parameters (only known groups are supported, not arbitrary domains, to
538 * avoid validation issues).
539 *
540 * Disable if you only need to support RFC 5915 + 5480 key formats.
541 */
542#define MBEDTLS_PK_PARSE_EC_EXTENDED
543
544/**
545 * \def MBEDTLS_ERROR_STRERROR_DUMMY
546 *
547 * Enable a dummy error function to make use of mbedtls_strerror() in
548 * third party libraries easier when MBEDTLS_ERROR_C is disabled
549 * (no effect when MBEDTLS_ERROR_C is enabled).
550 *
551 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
552 * not using mbedtls_strerror() or error_strerror() in your application.
553 *
554 * Disable if you run into name conflicts and want to really remove the
555 * mbedtls_strerror()
556 */
557#define MBEDTLS_ERROR_STRERROR_DUMMY
558
559/**
560 * \def MBEDTLS_GENPRIME
561 *
562 * Enable the prime-number generation code.
563 *
564 * Requires: MBEDTLS_BIGNUM_C
565 */
566#define MBEDTLS_GENPRIME
567
568/**
569 * \def MBEDTLS_FS_IO
570 *
571 * Enable functions that use the filesystem.
572 */
573#define MBEDTLS_FS_IO
574
575/**
576 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
577 *
578 * Do not add default entropy sources. These are the platform specific,
579 * mbedtls_timing_hardclock and HAVEGE based poll functions.
580 *
581 * This is useful to have more control over the added entropy sources in an
582 * application.
583 *
584 * Uncomment this macro to prevent loading of default entropy functions.
585 */
586//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
587
588/**
589 * \def MBEDTLS_NO_PLATFORM_ENTROPY
590 *
591 * Do not use built-in platform entropy functions.
592 * This is useful if your platform does not support
593 * standards like the /dev/urandom or Windows CryptoAPI.
594 *
595 * Uncomment this macro to disable the built-in platform entropy functions.
596 */
597//#define MBEDTLS_NO_PLATFORM_ENTROPY
598
599/**
600 * \def MBEDTLS_ENTROPY_FORCE_SHA256
601 *
602 * Force the entropy accumulator to use a SHA-256 accumulator instead of the
603 * default SHA-512 based one (if both are available).
604 *
605 * Requires: MBEDTLS_SHA256_C
606 *
607 * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
608 * if you have performance concerns.
609 *
610 * This option is only useful if both MBEDTLS_SHA256_C and
611 * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
612 */
613//#define MBEDTLS_ENTROPY_FORCE_SHA256
614
615/**
616 * \def MBEDTLS_ENTROPY_NV_SEED
617 *
618 * Enable the non-volatile (NV) seed file-based entropy source.
619 * (Also enables the NV seed read/write functions in the platform layer)
620 *
621 * This is crucial (if not required) on systems that do not have a
622 * cryptographic entropy source (in hardware or kernel) available.
623 *
624 * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
625 *
626 * \note The read/write functions that are used by the entropy source are
627 * determined in the platform layer, and can be modified at runtime and/or
628 * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
629 *
630 * \note If you use the default implementation functions that read a seedfile
631 * with regular fopen(), please make sure you make a seedfile with the
632 * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
633 * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
634 * and written to or you will get an entropy source error! The default
635 * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
636 * bytes from the file.
637 *
638 * \note The entropy collector will write to the seed file before entropy is
639 * given to an external source, to update it.
640 */
641//#define MBEDTLS_ENTROPY_NV_SEED
642
643/**
644 * \def MBEDTLS_MEMORY_DEBUG
645 *
646 * Enable debugging of buffer allocator memory issues. Automatically prints
647 * (to stderr) all (fatal) messages on memory allocation issues. Enables
648 * function for 'debug output' of allocated memory.
649 *
650 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
651 *
652 * Uncomment this macro to let the buffer allocator print out error messages.
653 */
654//#define MBEDTLS_MEMORY_DEBUG
655
656/**
657 * \def MBEDTLS_MEMORY_BACKTRACE
658 *
659 * Include backtrace information with each allocated block.
660 *
661 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
662 * GLIBC-compatible backtrace() an backtrace_symbols() support
663 *
664 * Uncomment this macro to include backtrace information
665 */
666//#define MBEDTLS_MEMORY_BACKTRACE
667
668/**
669 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
670 *
671 * Support external private RSA keys (eg from a HSM) in the PK layer.
672 *
673 * Comment this macro to disable support for external private RSA keys.
674 */
675#define MBEDTLS_PK_RSA_ALT_SUPPORT
676
677/**
678 * \def MBEDTLS_PKCS1_V15
679 *
680 * Enable support for PKCS#1 v1.5 encoding.
681 *
682 * Requires: MBEDTLS_RSA_C
683 *
684 * This enables support for PKCS#1 v1.5 operations.
685 */
686#define MBEDTLS_PKCS1_V15
687
688/**
689 * \def MBEDTLS_PKCS1_V21
690 *
691 * Enable support for PKCS#1 v2.1 encoding.
692 *
693 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
694 *
695 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
696 */
697#define MBEDTLS_PKCS1_V21
698
699/**
Jaeden Amero67a93512018-07-11 16:07:40 +0100700 * \def MBEDTLS_PSA_CRYPTO_SPM
701 *
702 * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure
703 * Partition Manager) integration which separates the code into two parts: a
704 * NSPE (Non-Secure Process Environment) and an SPE (Secure Process
705 * Environment).
706 *
707 * Module: library/psa_crypto.c
708 * Requires: MBEDTLS_PSA_CRYPTO_C
709 *
710 */
711//#define MBEDTLS_PSA_CRYPTO_SPM
712
713/**
Gilles Peskined8374ba2018-02-16 20:36:55 +0100714 * \def MBEDTLS_RSA_NO_CRT
715 *
716 * Do not use the Chinese Remainder Theorem for the RSA private operation.
717 *
718 * Uncomment this macro to disable the use of CRT in RSA.
719 *
720 */
721//#define MBEDTLS_RSA_NO_CRT
722
723/**
724 * \def MBEDTLS_SELF_TEST
725 *
726 * Enable the checkup functions (*_self_test).
727 */
728#define MBEDTLS_SELF_TEST
729
730/**
731 * \def MBEDTLS_SHA256_SMALLER
732 *
733 * Enable an implementation of SHA-256 that has lower ROM footprint but also
734 * lower performance.
735 *
736 * The default implementation is meant to be a reasonnable compromise between
737 * performance and size. This version optimizes more aggressively for size at
738 * the expense of performance. Eg on Cortex-M4 it reduces the size of
739 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
740 * 30%.
741 *
742 * Uncomment to enable the smaller implementation of SHA256.
743 */
744//#define MBEDTLS_SHA256_SMALLER
745
746/**
747 * \def MBEDTLS_THREADING_ALT
748 *
749 * Provide your own alternate threading implementation.
750 *
751 * Requires: MBEDTLS_THREADING_C
752 *
753 * Uncomment this to allow your own alternate threading implementation.
754 */
755//#define MBEDTLS_THREADING_ALT
756
757/**
758 * \def MBEDTLS_THREADING_PTHREAD
759 *
760 * Enable the pthread wrapper layer for the threading layer.
761 *
762 * Requires: MBEDTLS_THREADING_C
763 *
764 * Uncomment this to enable pthread mutexes.
765 */
766//#define MBEDTLS_THREADING_PTHREAD
767
768/**
769 * \def MBEDTLS_VERSION_FEATURES
770 *
771 * Allow run-time checking of compile-time enabled features. Thus allowing users
772 * to check at run-time if the library is for instance compiled with threading
773 * support via mbedtls_version_check_feature().
774 *
775 * Requires: MBEDTLS_VERSION_C
776 *
777 * Comment this to disable run-time checking and save ROM space
778 */
779#define MBEDTLS_VERSION_FEATURES
780
781/* \} name SECTION: mbed TLS feature support */
782
783/**
784 * \name SECTION: mbed TLS modules
785 *
786 * This section enables or disables entire modules in mbed TLS
787 * \{
788 */
789
790/**
791 * \def MBEDTLS_AESNI_C
792 *
793 * Enable AES-NI support on x86-64.
794 *
795 * Module: library/aesni.c
796 * Caller: library/aes.c
797 *
798 * Requires: MBEDTLS_HAVE_ASM
799 *
800 * This modules adds support for the AES-NI instructions on x86-64
801 */
802#define MBEDTLS_AESNI_C
803
804/**
805 * \def MBEDTLS_AES_C
806 *
807 * Enable the AES block cipher.
808 *
809 * Module: library/aes.c
810 * Caller: library/ssl_tls.c
811 * library/pem.c
812 * library/ctr_drbg.c
813 *
814 * This module enables the following ciphersuites (if other requisites are
815 * enabled as well):
816 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
817 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
818 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
819 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
820 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
821 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
822 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
823 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
824 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
825 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
826 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
827 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
828 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
829 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
830 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
831 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
832 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
833 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
834 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
835 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
836 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
837 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
838 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
839 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
840 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
841 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
842 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
843 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
844 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
845 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
846 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
847 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
848 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
849 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
850 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
851 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
852 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
853 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
854 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
855 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
856 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
857 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
858 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
859 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
860 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
861 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
862 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
863 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
864 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
865 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
866 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
867 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
868 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
869 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
870 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
871 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
872 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
873 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
874 *
875 * PEM_PARSE uses AES for decrypting encrypted keys.
876 */
877#define MBEDTLS_AES_C
878
879/**
880 * \def MBEDTLS_ARC4_C
881 *
882 * Enable the ARCFOUR stream cipher.
883 *
884 * Module: library/arc4.c
885 * Caller: library/ssl_tls.c
886 *
887 * This module enables the following ciphersuites (if other requisites are
888 * enabled as well):
889 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
890 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
891 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
892 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
893 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
894 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
895 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
896 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
897 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
898 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
899 *
900 * \warning ARC4 is considered a weak cipher and its use constitutes a
901 * security risk. If possible, we recommend avoidng dependencies on
902 * it, and considering stronger ciphers instead.
903 *
904 */
905#define MBEDTLS_ARC4_C
906
907/**
908 * \def MBEDTLS_ASN1_PARSE_C
909 *
910 * Enable the generic ASN1 parser.
911 *
912 * Module: library/asn1.c
913 * Caller: library/x509.c
914 * library/dhm.c
915 * library/pkcs12.c
916 * library/pkcs5.c
917 * library/pkparse.c
918 */
919#define MBEDTLS_ASN1_PARSE_C
920
921/**
922 * \def MBEDTLS_ASN1_WRITE_C
923 *
924 * Enable the generic ASN1 writer.
925 *
926 * Module: library/asn1write.c
927 * Caller: library/ecdsa.c
928 * library/pkwrite.c
929 * library/x509_create.c
930 * library/x509write_crt.c
931 * library/x509write_csr.c
932 */
933#define MBEDTLS_ASN1_WRITE_C
934
935/**
936 * \def MBEDTLS_BASE64_C
937 *
938 * Enable the Base64 module.
939 *
940 * Module: library/base64.c
941 * Caller: library/pem.c
942 *
943 * This module is required for PEM support (required by X.509).
944 */
945#define MBEDTLS_BASE64_C
946
947/**
948 * \def MBEDTLS_BIGNUM_C
949 *
950 * Enable the multi-precision integer library.
951 *
952 * Module: library/bignum.c
953 * Caller: library/dhm.c
954 * library/ecp.c
955 * library/ecdsa.c
956 * library/rsa.c
957 * library/rsa_internal.c
958 * library/ssl_tls.c
959 *
960 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
961 */
962#define MBEDTLS_BIGNUM_C
963
964/**
965 * \def MBEDTLS_BLOWFISH_C
966 *
967 * Enable the Blowfish block cipher.
968 *
969 * Module: library/blowfish.c
970 */
971#define MBEDTLS_BLOWFISH_C
972
973/**
974 * \def MBEDTLS_CAMELLIA_C
975 *
976 * Enable the Camellia block cipher.
977 *
978 * Module: library/camellia.c
979 * Caller: library/ssl_tls.c
980 *
981 * This module enables the following ciphersuites (if other requisites are
982 * enabled as well):
983 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
984 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
985 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
986 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
987 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
988 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
989 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
990 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
991 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
992 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
993 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
994 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
995 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
996 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
997 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
998 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
999 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1000 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1001 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1002 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1003 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1004 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1005 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
1006 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1007 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1008 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
1009 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1010 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1011 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1012 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
1013 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
1014 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
1015 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
1016 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
1017 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
1018 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
1019 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
1020 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
1021 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
1022 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
1023 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
1024 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
1025 */
1026#define MBEDTLS_CAMELLIA_C
1027
1028/**
1029 * \def MBEDTLS_CCM_C
1030 *
1031 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
1032 *
1033 * Module: library/ccm.c
1034 *
1035 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
1036 *
1037 * This module enables the AES-CCM ciphersuites, if other requisites are
1038 * enabled as well.
1039 */
1040#define MBEDTLS_CCM_C
1041
1042/**
1043 * \def MBEDTLS_CIPHER_C
1044 *
1045 * Enable the generic cipher layer.
1046 *
1047 * Module: library/cipher.c
1048 * Caller: library/ssl_tls.c
1049 *
1050 * Uncomment to enable generic cipher wrappers.
1051 */
1052#define MBEDTLS_CIPHER_C
1053
1054/**
1055 * \def MBEDTLS_CMAC_C
1056 *
1057 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
1058 * ciphers.
1059 *
1060 * Module: library/cmac.c
1061 *
1062 * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
1063 *
1064 */
1065#define MBEDTLS_CMAC_C
1066
1067/**
1068 * \def MBEDTLS_CTR_DRBG_C
1069 *
1070 * Enable the CTR_DRBG AES-256-based random generator.
1071 *
1072 * Module: library/ctr_drbg.c
1073 * Caller:
1074 *
1075 * Requires: MBEDTLS_AES_C
1076 *
1077 * This module provides the CTR_DRBG AES-256 random number generator.
1078 */
1079#define MBEDTLS_CTR_DRBG_C
1080
1081/**
1082 * \def MBEDTLS_DES_C
1083 *
1084 * Enable the DES block cipher.
1085 *
1086 * Module: library/des.c
1087 * Caller: library/pem.c
1088 * library/ssl_tls.c
1089 *
1090 * This module enables the following ciphersuites (if other requisites are
1091 * enabled as well):
1092 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
1093 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
1094 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
1095 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
1096 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
1097 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
1098 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
1099 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
1100 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
1101 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
1102 *
1103 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
1104 *
1105 * \warning DES is considered a weak cipher and its use constitutes a
1106 * security risk. We recommend considering stronger ciphers instead.
1107 */
1108#define MBEDTLS_DES_C
1109
1110/**
1111 * \def MBEDTLS_DHM_C
1112 *
1113 * Enable the Diffie-Hellman-Merkle module.
1114 *
1115 * Module: library/dhm.c
1116 * Caller: library/ssl_cli.c
1117 * library/ssl_srv.c
1118 *
1119 * This module is used by the following key exchanges:
1120 * DHE-RSA, DHE-PSK
1121 *
1122 * \warning Using DHE constitutes a security risk as it
1123 * is not possible to validate custom DH parameters.
1124 * If possible, it is recommended users should consider
1125 * preferring other methods of key exchange.
1126 * See dhm.h for more details.
1127 *
1128 */
1129#define MBEDTLS_DHM_C
1130
1131/**
1132 * \def MBEDTLS_ECDH_C
1133 *
1134 * Enable the elliptic curve Diffie-Hellman library.
1135 *
1136 * Module: library/ecdh.c
1137 * Caller: library/ssl_cli.c
1138 * library/ssl_srv.c
1139 *
1140 * This module is used by the following key exchanges:
1141 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
1142 *
1143 * Requires: MBEDTLS_ECP_C
1144 */
1145#define MBEDTLS_ECDH_C
1146
1147/**
1148 * \def MBEDTLS_ECDSA_C
1149 *
1150 * Enable the elliptic curve DSA library.
1151 *
1152 * Module: library/ecdsa.c
1153 * Caller:
1154 *
1155 * This module is used by the following key exchanges:
1156 * ECDHE-ECDSA
1157 *
1158 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
1159 */
1160#define MBEDTLS_ECDSA_C
1161
1162/**
1163 * \def MBEDTLS_ECJPAKE_C
1164 *
1165 * Enable the elliptic curve J-PAKE library.
1166 *
1167 * \warning This is currently experimental. EC J-PAKE support is based on the
1168 * Thread v1.0.0 specification; incompatible changes to the specification
1169 * might still happen. For this reason, this is disabled by default.
1170 *
1171 * Module: library/ecjpake.c
1172 * Caller:
1173 *
1174 * This module is used by the following key exchanges:
1175 * ECJPAKE
1176 *
1177 * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
1178 */
1179#define MBEDTLS_ECJPAKE_C
1180
1181/**
1182 * \def MBEDTLS_ECP_C
1183 *
1184 * Enable the elliptic curve over GF(p) library.
1185 *
1186 * Module: library/ecp.c
1187 * Caller: library/ecdh.c
1188 * library/ecdsa.c
1189 * library/ecjpake.c
1190 *
1191 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
1192 */
1193#define MBEDTLS_ECP_C
1194
1195/**
1196 * \def MBEDTLS_ENTROPY_C
1197 *
1198 * Enable the platform-specific entropy code.
1199 *
1200 * Module: library/entropy.c
1201 * Caller:
1202 *
1203 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
1204 *
1205 * This module provides a generic entropy pool
1206 */
1207#define MBEDTLS_ENTROPY_C
1208
1209/**
1210 * \def MBEDTLS_ERROR_C
1211 *
1212 * Enable error code to error string conversion.
1213 *
1214 * Module: library/error.c
1215 * Caller:
1216 *
1217 * This module enables mbedtls_strerror().
1218 */
1219#define MBEDTLS_ERROR_C
1220
1221/**
1222 * \def MBEDTLS_GCM_C
1223 *
1224 * Enable the Galois/Counter Mode (GCM) for AES.
1225 *
1226 * Module: library/gcm.c
1227 *
1228 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
1229 *
1230 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
1231 * requisites are enabled as well.
1232 */
1233#define MBEDTLS_GCM_C
1234
1235/**
Gilles Peskined8374ba2018-02-16 20:36:55 +01001236 * \def MBEDTLS_HMAC_DRBG_C
1237 *
1238 * Enable the HMAC_DRBG random generator.
1239 *
1240 * Module: library/hmac_drbg.c
1241 * Caller:
1242 *
1243 * Requires: MBEDTLS_MD_C
1244 *
1245 * Uncomment to enable the HMAC_DRBG random number geerator.
1246 */
1247#define MBEDTLS_HMAC_DRBG_C
1248
1249/**
1250 * \def MBEDTLS_MD_C
1251 *
1252 * Enable the generic message digest layer.
1253 *
1254 * Module: library/md.c
1255 * Caller:
1256 *
1257 * Uncomment to enable generic message digest wrappers.
1258 */
1259#define MBEDTLS_MD_C
1260
1261/**
1262 * \def MBEDTLS_MD2_C
1263 *
1264 * Enable the MD2 hash algorithm.
1265 *
1266 * Module: library/md2.c
1267 * Caller:
1268 *
1269 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1270 *
1271 * \warning MD2 is considered a weak message digest and its use constitutes a
1272 * security risk. If possible, we recommend avoiding dependencies on
1273 * it, and considering stronger message digests instead.
1274 *
1275 */
1276#define MBEDTLS_MD2_C
1277
1278/**
1279 * \def MBEDTLS_MD4_C
1280 *
1281 * Enable the MD4 hash algorithm.
1282 *
1283 * Module: library/md4.c
1284 * Caller:
1285 *
1286 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1287 *
1288 * \warning MD4 is considered a weak message digest and its use constitutes a
1289 * security risk. If possible, we recommend avoiding dependencies on
1290 * it, and considering stronger message digests instead.
1291 *
1292 */
1293#define MBEDTLS_MD4_C
1294
1295/**
1296 * \def MBEDTLS_MD5_C
1297 *
1298 * Enable the MD5 hash algorithm.
1299 *
1300 * Module: library/md5.c
1301 * Caller: library/md.c
1302 * library/pem.c
1303 * library/ssl_tls.c
1304 *
1305 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
1306 * depending on the handshake parameters. Further, it is used for checking
1307 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
1308 * encrypted keys.
1309 *
1310 * \warning MD5 is considered a weak message digest and its use constitutes a
1311 * security risk. If possible, we recommend avoiding dependencies on
1312 * it, and considering stronger message digests instead.
1313 *
1314 */
1315#define MBEDTLS_MD5_C
1316
1317/**
1318 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
1319 *
1320 * Enable the buffer allocator implementation that makes use of a (stack)
1321 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
1322 * calls)
1323 *
1324 * Module: library/memory_buffer_alloc.c
1325 *
1326 * Requires: MBEDTLS_PLATFORM_C
1327 * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
1328 *
1329 * Enable this module to enable the buffer memory allocator.
1330 */
1331//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
1332
1333/**
1334 * \def MBEDTLS_OID_C
1335 *
1336 * Enable the OID database.
1337 *
1338 * Module: library/oid.c
1339 * Caller: library/asn1write.c
1340 * library/pkcs5.c
1341 * library/pkparse.c
1342 * library/pkwrite.c
1343 * library/rsa.c
1344 * library/x509.c
1345 * library/x509_create.c
1346 * library/x509_crl.c
1347 * library/x509_crt.c
1348 * library/x509_csr.c
1349 * library/x509write_crt.c
1350 * library/x509write_csr.c
1351 *
1352 * This modules translates between OIDs and internal values.
1353 */
1354#define MBEDTLS_OID_C
1355
1356/**
1357 * \def MBEDTLS_PADLOCK_C
1358 *
1359 * Enable VIA Padlock support on x86.
1360 *
1361 * Module: library/padlock.c
1362 * Caller: library/aes.c
1363 *
1364 * Requires: MBEDTLS_HAVE_ASM
1365 *
1366 * This modules adds support for the VIA PadLock on x86.
1367 */
1368//#define MBEDTLS_PADLOCK_C
1369
1370/**
1371 * \def MBEDTLS_PEM_PARSE_C
1372 *
1373 * Enable PEM decoding / parsing.
1374 *
1375 * Module: library/pem.c
1376 * Caller: library/dhm.c
1377 * library/pkparse.c
1378 * library/x509_crl.c
1379 * library/x509_crt.c
1380 * library/x509_csr.c
1381 *
1382 * Requires: MBEDTLS_BASE64_C
1383 *
1384 * This modules adds support for decoding / parsing PEM files.
1385 */
1386#define MBEDTLS_PEM_PARSE_C
1387
1388/**
1389 * \def MBEDTLS_PEM_WRITE_C
1390 *
1391 * Enable PEM encoding / writing.
1392 *
1393 * Module: library/pem.c
1394 * Caller: library/pkwrite.c
1395 * library/x509write_crt.c
1396 * library/x509write_csr.c
1397 *
1398 * Requires: MBEDTLS_BASE64_C
1399 *
1400 * This modules adds support for encoding / writing PEM files.
1401 */
1402#define MBEDTLS_PEM_WRITE_C
1403
1404/**
1405 * \def MBEDTLS_PK_C
1406 *
1407 * Enable the generic public (asymetric) key layer.
1408 *
1409 * Module: library/pk.c
1410 * Caller: library/ssl_tls.c
1411 * library/ssl_cli.c
1412 * library/ssl_srv.c
1413 *
1414 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
1415 *
1416 * Uncomment to enable generic public key wrappers.
1417 */
1418#define MBEDTLS_PK_C
1419
1420/**
1421 * \def MBEDTLS_PK_PARSE_C
1422 *
1423 * Enable the generic public (asymetric) key parser.
1424 *
1425 * Module: library/pkparse.c
1426 * Caller: library/x509_crt.c
1427 * library/x509_csr.c
1428 *
1429 * Requires: MBEDTLS_PK_C
1430 *
1431 * Uncomment to enable generic public key parse functions.
1432 */
1433#define MBEDTLS_PK_PARSE_C
1434
1435/**
1436 * \def MBEDTLS_PK_WRITE_C
1437 *
1438 * Enable the generic public (asymetric) key writer.
1439 *
1440 * Module: library/pkwrite.c
1441 * Caller: library/x509write.c
1442 *
1443 * Requires: MBEDTLS_PK_C
1444 *
1445 * Uncomment to enable generic public key write functions.
1446 */
1447#define MBEDTLS_PK_WRITE_C
1448
1449/**
1450 * \def MBEDTLS_PKCS5_C
1451 *
1452 * Enable PKCS#5 functions.
1453 *
1454 * Module: library/pkcs5.c
1455 *
1456 * Requires: MBEDTLS_MD_C
1457 *
1458 * This module adds support for the PKCS#5 functions.
1459 */
1460#define MBEDTLS_PKCS5_C
1461
1462/**
1463 * \def MBEDTLS_PKCS11_C
1464 *
1465 * Enable wrapper for PKCS#11 smartcard support.
1466 *
1467 * Module: library/pkcs11.c
1468 * Caller: library/pk.c
1469 *
1470 * Requires: MBEDTLS_PK_C
1471 *
1472 * This module enables SSL/TLS PKCS #11 smartcard support.
1473 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1474 */
1475//#define MBEDTLS_PKCS11_C
1476
1477/**
1478 * \def MBEDTLS_PKCS12_C
1479 *
1480 * Enable PKCS#12 PBE functions.
1481 * Adds algorithms for parsing PKCS#8 encrypted private keys
1482 *
1483 * Module: library/pkcs12.c
1484 * Caller: library/pkparse.c
1485 *
1486 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
1487 * Can use: MBEDTLS_ARC4_C
1488 *
1489 * This module enables PKCS#12 functions.
1490 */
1491#define MBEDTLS_PKCS12_C
1492
1493/**
1494 * \def MBEDTLS_PLATFORM_C
1495 *
1496 * Enable the platform abstraction layer that allows you to re-assign
1497 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
1498 *
1499 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
1500 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
1501 * above to be specified at runtime or compile time respectively.
1502 *
1503 * \note This abstraction layer must be enabled on Windows (including MSYS2)
1504 * as other module rely on it for a fixed snprintf implementation.
1505 *
1506 * Module: library/platform.c
1507 * Caller: Most other .c files
1508 *
1509 * This module enables abstraction of common (libc) functions.
1510 */
1511#define MBEDTLS_PLATFORM_C
1512
1513/**
1514 * \def MBEDTLS_PSA_CRYPTO_C
1515 *
1516 * Enable the Platform Security Architecture cryptography API.
1517 *
1518 * Module: library/psa_crypto.c
1519 *
1520 * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C
1521 *
1522 */
1523#define MBEDTLS_PSA_CRYPTO_C
1524
1525/**
Darryl Greendb2b8db2018-06-15 13:06:04 +01001526 * \def MBEDTLS_PSA_CRYPTO_STORAGE_C
1527 *
1528 * Enable the Platform Security Architecture persistent key storage.
1529 *
1530 * Module: library/psa_crypto_storage.c
1531 *
Moran Peker46119562018-11-20 18:30:34 +02001532 * Requires: MBEDTLS_PSA_CRYPTO_C and one of either
1533 * MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C or MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
1534 * (but not both)
Darryl Greendb2b8db2018-06-15 13:06:04 +01001535 *
1536 */
1537#define MBEDTLS_PSA_CRYPTO_STORAGE_C
1538
1539/**
1540 * \def MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C
1541 *
1542 * Enable persistent key storage over files for the
1543 * Platform Security Architecture cryptography API.
1544 *
1545 * Module: library/psa_crypto_storage_file.c
1546 *
1547 * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_FS_IO
1548 *
1549 */
1550#define MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C
1551
1552/**
Moran Peker46119562018-11-20 18:30:34 +02001553 * \def MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
1554 *
1555 * Enable persistent key storage over PSA ITS for the
1556 * Platform Security Architecture cryptography API.
1557 *
1558 * Module: library/psa_crypto_storage_its.c
1559 *
1560 * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_HAS_ITS_IO
1561 *
1562 */
1563//#define MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
1564
1565/**
Gilles Peskined8374ba2018-02-16 20:36:55 +01001566 * \def MBEDTLS_RIPEMD160_C
1567 *
1568 * Enable the RIPEMD-160 hash algorithm.
1569 *
1570 * Module: library/ripemd160.c
1571 * Caller: library/md.c
1572 *
1573 */
1574#define MBEDTLS_RIPEMD160_C
1575
1576/**
1577 * \def MBEDTLS_RSA_C
1578 *
1579 * Enable the RSA public-key cryptosystem.
1580 *
1581 * Module: library/rsa.c
1582 * library/rsa_internal.c
1583 * Caller: library/ssl_cli.c
1584 * library/ssl_srv.c
1585 * library/ssl_tls.c
1586 * library/x509.c
1587 *
1588 * This module is used by the following key exchanges:
1589 * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
1590 *
1591 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
1592 */
1593#define MBEDTLS_RSA_C
1594
1595/**
1596 * \def MBEDTLS_SHA1_C
1597 *
1598 * Enable the SHA1 cryptographic hash algorithm.
1599 *
1600 * Module: library/sha1.c
1601 * Caller: library/md.c
1602 * library/ssl_cli.c
1603 * library/ssl_srv.c
1604 * library/ssl_tls.c
1605 * library/x509write_crt.c
1606 *
1607 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
1608 * depending on the handshake parameters, and for SHA1-signed certificates.
1609 *
1610 * \warning SHA-1 is considered a weak message digest and its use constitutes
1611 * a security risk. If possible, we recommend avoiding dependencies
1612 * on it, and considering stronger message digests instead.
1613 *
1614 */
1615#define MBEDTLS_SHA1_C
1616
1617/**
1618 * \def MBEDTLS_SHA256_C
1619 *
1620 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
1621 *
1622 * Module: library/sha256.c
1623 * Caller: library/entropy.c
1624 * library/md.c
1625 * library/ssl_cli.c
1626 * library/ssl_srv.c
1627 * library/ssl_tls.c
1628 *
1629 * This module adds support for SHA-224 and SHA-256.
1630 * This module is required for the SSL/TLS 1.2 PRF function.
1631 */
1632#define MBEDTLS_SHA256_C
1633
1634/**
1635 * \def MBEDTLS_SHA512_C
1636 *
1637 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
1638 *
1639 * Module: library/sha512.c
1640 * Caller: library/entropy.c
1641 * library/md.c
1642 * library/ssl_cli.c
1643 * library/ssl_srv.c
1644 *
1645 * This module adds support for SHA-384 and SHA-512.
1646 */
1647#define MBEDTLS_SHA512_C
1648
1649/**
1650 * \def MBEDTLS_THREADING_C
1651 *
1652 * Enable the threading abstraction layer.
1653 * By default mbed TLS assumes it is used in a non-threaded environment or that
1654 * contexts are not shared between threads. If you do intend to use contexts
1655 * between threads, you will need to enable this layer to prevent race
1656 * conditions. See also our Knowledge Base article about threading:
1657 * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
1658 *
1659 * Module: library/threading.c
1660 *
1661 * This allows different threading implementations (self-implemented or
1662 * provided).
1663 *
1664 * You will have to enable either MBEDTLS_THREADING_ALT or
1665 * MBEDTLS_THREADING_PTHREAD.
1666 *
1667 * Enable this layer to allow use of mutexes within mbed TLS
1668 */
1669//#define MBEDTLS_THREADING_C
1670
1671/**
1672 * \def MBEDTLS_VERSION_C
1673 *
1674 * Enable run-time version information.
1675 *
1676 * Module: library/version.c
1677 *
1678 * This module provides run-time version information.
1679 */
1680#define MBEDTLS_VERSION_C
1681
1682/**
1683 * \def MBEDTLS_XTEA_C
1684 *
1685 * Enable the XTEA block cipher.
1686 *
1687 * Module: library/xtea.c
1688 * Caller:
1689 */
1690#define MBEDTLS_XTEA_C
1691
1692/* \} name SECTION: mbed TLS modules */
1693
1694/**
1695 * \name SECTION: Module configuration options
1696 *
1697 * This section allows for the setting of module specific sizes and
1698 * configuration options. The default values are already present in the
1699 * relevant header files and should suffice for the regular use cases.
1700 *
1701 * Our advice is to enable options and change their values here
1702 * only if you have a good reason and know the consequences.
1703 *
1704 * Please check the respective header file for documentation on these
1705 * parameters (to prevent duplicate documentation).
1706 * \{
1707 */
1708
1709/* MPI / BIGNUM options */
1710//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1711//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
1712
1713/* CTR_DRBG options */
1714//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
1715//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1716//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1717//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1718//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1719
1720/* HMAC_DRBG options */
1721//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1722//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1723//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1724//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1725
1726/* ECP options */
1727//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
1728//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
1729//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
1730
1731/* Entropy options */
1732//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1733//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1734//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
1735
1736/* Memory buffer allocator options */
1737//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1738
1739/* Platform options */
1740//#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. */
1741//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
1742//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
1743//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
1744//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1745//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
1746//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
1747/* Note: your snprintf must correclty zero-terminate the buffer! */
1748//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
1749//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
1750//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
1751//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1752//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
1753//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
1754
1755/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
1756/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
1757//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
1758//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
1759//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
1760//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1761//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1762//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
1763//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
1764/* Note: your snprintf must correclty zero-terminate the buffer! */
1765//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
1766//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1767//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
1768
Gilles Peskine13187932018-06-19 11:49:23 +02001769/**
1770 * Uncomment the macro to let mbed TLS use your alternate implementation of
1771 * mbedtls_platform_zeroize(). This replaces the default implementation in
1772 * platform_util.c.
1773 *
1774 * mbedtls_platform_zeroize() is a widely used function across the library to
1775 * zero a block of memory. The implementation is expected to be secure in the
1776 * sense that it has been written to prevent the compiler from removing calls
1777 * to mbedtls_platform_zeroize() as part of redundant code elimination
1778 * optimizations. However, it is difficult to guarantee that calls to
1779 * mbedtls_platform_zeroize() will not be optimized by the compiler as older
1780 * versions of the C language standards do not provide a secure implementation
1781 * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to
1782 * configure their own implementation of mbedtls_platform_zeroize(), for
1783 * example by using directives specific to their compiler, features from newer
1784 * C standards (e.g using memset_s() in C11) or calling a secure memset() from
1785 * their system (e.g explicit_bzero() in BSD).
1786 */
1787//#define MBEDTLS_PLATFORM_ZEROIZE_ALT
1788
Gilles Peskined8374ba2018-02-16 20:36:55 +01001789/* \} name SECTION: Customisation configuration options */
1790
1791#include "mbedtls/check_config.h"
1792
1793#endif /* MBEDTLS_CONFIG_H */