blob: c9a8ebd6269c609aa46791c65e452229d53cdf9c [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/**
Moran Pekera90abf12018-11-20 18:32:25 +0200714 * \def MBEDTLS_PSA_HAS_ITS_IO
715 *
716 * Enable the non-volatile secure storage usage.
717 *
718 * This is crucial on systems that do not have a HW TRNG support.
719 *
720 */
721//#define MBEDTLS_PSA_HAS_ITS_IO
722
723/**
Gilles Peskined8374ba2018-02-16 20:36:55 +0100724 * \def MBEDTLS_RSA_NO_CRT
725 *
726 * Do not use the Chinese Remainder Theorem for the RSA private operation.
727 *
728 * Uncomment this macro to disable the use of CRT in RSA.
729 *
730 */
731//#define MBEDTLS_RSA_NO_CRT
732
733/**
734 * \def MBEDTLS_SELF_TEST
735 *
736 * Enable the checkup functions (*_self_test).
737 */
738#define MBEDTLS_SELF_TEST
739
740/**
741 * \def MBEDTLS_SHA256_SMALLER
742 *
743 * Enable an implementation of SHA-256 that has lower ROM footprint but also
744 * lower performance.
745 *
746 * The default implementation is meant to be a reasonnable compromise between
747 * performance and size. This version optimizes more aggressively for size at
748 * the expense of performance. Eg on Cortex-M4 it reduces the size of
749 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
750 * 30%.
751 *
752 * Uncomment to enable the smaller implementation of SHA256.
753 */
754//#define MBEDTLS_SHA256_SMALLER
755
756/**
757 * \def MBEDTLS_THREADING_ALT
758 *
759 * Provide your own alternate threading implementation.
760 *
761 * Requires: MBEDTLS_THREADING_C
762 *
763 * Uncomment this to allow your own alternate threading implementation.
764 */
765//#define MBEDTLS_THREADING_ALT
766
767/**
768 * \def MBEDTLS_THREADING_PTHREAD
769 *
770 * Enable the pthread wrapper layer for the threading layer.
771 *
772 * Requires: MBEDTLS_THREADING_C
773 *
774 * Uncomment this to enable pthread mutexes.
775 */
776//#define MBEDTLS_THREADING_PTHREAD
777
778/**
779 * \def MBEDTLS_VERSION_FEATURES
780 *
781 * Allow run-time checking of compile-time enabled features. Thus allowing users
782 * to check at run-time if the library is for instance compiled with threading
783 * support via mbedtls_version_check_feature().
784 *
785 * Requires: MBEDTLS_VERSION_C
786 *
787 * Comment this to disable run-time checking and save ROM space
788 */
789#define MBEDTLS_VERSION_FEATURES
790
791/* \} name SECTION: mbed TLS feature support */
792
793/**
794 * \name SECTION: mbed TLS modules
795 *
796 * This section enables or disables entire modules in mbed TLS
797 * \{
798 */
799
800/**
801 * \def MBEDTLS_AESNI_C
802 *
803 * Enable AES-NI support on x86-64.
804 *
805 * Module: library/aesni.c
806 * Caller: library/aes.c
807 *
808 * Requires: MBEDTLS_HAVE_ASM
809 *
810 * This modules adds support for the AES-NI instructions on x86-64
811 */
812#define MBEDTLS_AESNI_C
813
814/**
815 * \def MBEDTLS_AES_C
816 *
817 * Enable the AES block cipher.
818 *
819 * Module: library/aes.c
820 * Caller: library/ssl_tls.c
821 * library/pem.c
822 * library/ctr_drbg.c
823 *
824 * This module enables the following ciphersuites (if other requisites are
825 * enabled as well):
826 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
827 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
828 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
829 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
830 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
831 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
832 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
833 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
834 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
835 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
836 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
837 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
838 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
839 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
840 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
841 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
842 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
843 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
844 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
845 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
846 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
847 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
848 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
849 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
850 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
851 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
852 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
853 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
854 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
855 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
856 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
857 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
858 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
859 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
860 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
861 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
862 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
863 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
864 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
865 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
866 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
867 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
868 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
869 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
870 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
871 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
872 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
873 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
874 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
875 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
876 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
877 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
878 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
879 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
880 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
881 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
882 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
883 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
884 *
885 * PEM_PARSE uses AES for decrypting encrypted keys.
886 */
887#define MBEDTLS_AES_C
888
889/**
890 * \def MBEDTLS_ARC4_C
891 *
892 * Enable the ARCFOUR stream cipher.
893 *
894 * Module: library/arc4.c
895 * Caller: library/ssl_tls.c
896 *
897 * This module enables the following ciphersuites (if other requisites are
898 * enabled as well):
899 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
900 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
901 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
902 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
903 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
904 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
905 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
906 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
907 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
908 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
909 *
910 * \warning ARC4 is considered a weak cipher and its use constitutes a
911 * security risk. If possible, we recommend avoidng dependencies on
912 * it, and considering stronger ciphers instead.
913 *
914 */
915#define MBEDTLS_ARC4_C
916
917/**
918 * \def MBEDTLS_ASN1_PARSE_C
919 *
920 * Enable the generic ASN1 parser.
921 *
922 * Module: library/asn1.c
923 * Caller: library/x509.c
924 * library/dhm.c
925 * library/pkcs12.c
926 * library/pkcs5.c
927 * library/pkparse.c
928 */
929#define MBEDTLS_ASN1_PARSE_C
930
931/**
932 * \def MBEDTLS_ASN1_WRITE_C
933 *
934 * Enable the generic ASN1 writer.
935 *
936 * Module: library/asn1write.c
937 * Caller: library/ecdsa.c
938 * library/pkwrite.c
939 * library/x509_create.c
940 * library/x509write_crt.c
941 * library/x509write_csr.c
942 */
943#define MBEDTLS_ASN1_WRITE_C
944
945/**
946 * \def MBEDTLS_BASE64_C
947 *
948 * Enable the Base64 module.
949 *
950 * Module: library/base64.c
951 * Caller: library/pem.c
952 *
953 * This module is required for PEM support (required by X.509).
954 */
955#define MBEDTLS_BASE64_C
956
957/**
958 * \def MBEDTLS_BIGNUM_C
959 *
960 * Enable the multi-precision integer library.
961 *
962 * Module: library/bignum.c
963 * Caller: library/dhm.c
964 * library/ecp.c
965 * library/ecdsa.c
966 * library/rsa.c
967 * library/rsa_internal.c
968 * library/ssl_tls.c
969 *
970 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
971 */
972#define MBEDTLS_BIGNUM_C
973
974/**
975 * \def MBEDTLS_BLOWFISH_C
976 *
977 * Enable the Blowfish block cipher.
978 *
979 * Module: library/blowfish.c
980 */
981#define MBEDTLS_BLOWFISH_C
982
983/**
984 * \def MBEDTLS_CAMELLIA_C
985 *
986 * Enable the Camellia block cipher.
987 *
988 * Module: library/camellia.c
989 * Caller: library/ssl_tls.c
990 *
991 * This module enables the following ciphersuites (if other requisites are
992 * enabled as well):
993 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
994 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
995 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
996 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
997 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
998 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
999 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
1000 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
1001 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1002 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1003 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1004 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1005 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
1006 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
1007 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
1008 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1009 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1010 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1011 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1012 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1013 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1014 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1015 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
1016 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1017 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1018 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
1019 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1020 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1021 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1022 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
1023 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
1024 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
1025 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
1026 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
1027 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
1028 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
1029 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
1030 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
1031 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
1032 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
1033 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
1034 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
1035 */
1036#define MBEDTLS_CAMELLIA_C
1037
1038/**
1039 * \def MBEDTLS_CCM_C
1040 *
1041 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
1042 *
1043 * Module: library/ccm.c
1044 *
1045 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
1046 *
1047 * This module enables the AES-CCM ciphersuites, if other requisites are
1048 * enabled as well.
1049 */
1050#define MBEDTLS_CCM_C
1051
1052/**
1053 * \def MBEDTLS_CIPHER_C
1054 *
1055 * Enable the generic cipher layer.
1056 *
1057 * Module: library/cipher.c
1058 * Caller: library/ssl_tls.c
1059 *
1060 * Uncomment to enable generic cipher wrappers.
1061 */
1062#define MBEDTLS_CIPHER_C
1063
1064/**
1065 * \def MBEDTLS_CMAC_C
1066 *
1067 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
1068 * ciphers.
1069 *
1070 * Module: library/cmac.c
1071 *
1072 * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
1073 *
1074 */
1075#define MBEDTLS_CMAC_C
1076
1077/**
1078 * \def MBEDTLS_CTR_DRBG_C
1079 *
1080 * Enable the CTR_DRBG AES-256-based random generator.
1081 *
1082 * Module: library/ctr_drbg.c
1083 * Caller:
1084 *
1085 * Requires: MBEDTLS_AES_C
1086 *
1087 * This module provides the CTR_DRBG AES-256 random number generator.
1088 */
1089#define MBEDTLS_CTR_DRBG_C
1090
1091/**
1092 * \def MBEDTLS_DES_C
1093 *
1094 * Enable the DES block cipher.
1095 *
1096 * Module: library/des.c
1097 * Caller: library/pem.c
1098 * library/ssl_tls.c
1099 *
1100 * This module enables the following ciphersuites (if other requisites are
1101 * enabled as well):
1102 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
1103 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
1104 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
1105 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
1106 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
1107 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
1108 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
1109 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
1110 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
1111 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
1112 *
1113 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
1114 *
1115 * \warning DES is considered a weak cipher and its use constitutes a
1116 * security risk. We recommend considering stronger ciphers instead.
1117 */
1118#define MBEDTLS_DES_C
1119
1120/**
1121 * \def MBEDTLS_DHM_C
1122 *
1123 * Enable the Diffie-Hellman-Merkle module.
1124 *
1125 * Module: library/dhm.c
1126 * Caller: library/ssl_cli.c
1127 * library/ssl_srv.c
1128 *
1129 * This module is used by the following key exchanges:
1130 * DHE-RSA, DHE-PSK
1131 *
1132 * \warning Using DHE constitutes a security risk as it
1133 * is not possible to validate custom DH parameters.
1134 * If possible, it is recommended users should consider
1135 * preferring other methods of key exchange.
1136 * See dhm.h for more details.
1137 *
1138 */
1139#define MBEDTLS_DHM_C
1140
1141/**
1142 * \def MBEDTLS_ECDH_C
1143 *
1144 * Enable the elliptic curve Diffie-Hellman library.
1145 *
1146 * Module: library/ecdh.c
1147 * Caller: library/ssl_cli.c
1148 * library/ssl_srv.c
1149 *
1150 * This module is used by the following key exchanges:
1151 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
1152 *
1153 * Requires: MBEDTLS_ECP_C
1154 */
1155#define MBEDTLS_ECDH_C
1156
1157/**
1158 * \def MBEDTLS_ECDSA_C
1159 *
1160 * Enable the elliptic curve DSA library.
1161 *
1162 * Module: library/ecdsa.c
1163 * Caller:
1164 *
1165 * This module is used by the following key exchanges:
1166 * ECDHE-ECDSA
1167 *
1168 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
1169 */
1170#define MBEDTLS_ECDSA_C
1171
1172/**
1173 * \def MBEDTLS_ECJPAKE_C
1174 *
1175 * Enable the elliptic curve J-PAKE library.
1176 *
1177 * \warning This is currently experimental. EC J-PAKE support is based on the
1178 * Thread v1.0.0 specification; incompatible changes to the specification
1179 * might still happen. For this reason, this is disabled by default.
1180 *
1181 * Module: library/ecjpake.c
1182 * Caller:
1183 *
1184 * This module is used by the following key exchanges:
1185 * ECJPAKE
1186 *
1187 * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
1188 */
1189#define MBEDTLS_ECJPAKE_C
1190
1191/**
1192 * \def MBEDTLS_ECP_C
1193 *
1194 * Enable the elliptic curve over GF(p) library.
1195 *
1196 * Module: library/ecp.c
1197 * Caller: library/ecdh.c
1198 * library/ecdsa.c
1199 * library/ecjpake.c
1200 *
1201 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
1202 */
1203#define MBEDTLS_ECP_C
1204
1205/**
1206 * \def MBEDTLS_ENTROPY_C
1207 *
1208 * Enable the platform-specific entropy code.
1209 *
1210 * Module: library/entropy.c
1211 * Caller:
1212 *
1213 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
1214 *
1215 * This module provides a generic entropy pool
1216 */
1217#define MBEDTLS_ENTROPY_C
1218
1219/**
1220 * \def MBEDTLS_ERROR_C
1221 *
1222 * Enable error code to error string conversion.
1223 *
1224 * Module: library/error.c
1225 * Caller:
1226 *
1227 * This module enables mbedtls_strerror().
1228 */
1229#define MBEDTLS_ERROR_C
1230
1231/**
1232 * \def MBEDTLS_GCM_C
1233 *
1234 * Enable the Galois/Counter Mode (GCM) for AES.
1235 *
1236 * Module: library/gcm.c
1237 *
1238 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
1239 *
1240 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
1241 * requisites are enabled as well.
1242 */
1243#define MBEDTLS_GCM_C
1244
1245/**
Gilles Peskined8374ba2018-02-16 20:36:55 +01001246 * \def MBEDTLS_HMAC_DRBG_C
1247 *
1248 * Enable the HMAC_DRBG random generator.
1249 *
1250 * Module: library/hmac_drbg.c
1251 * Caller:
1252 *
1253 * Requires: MBEDTLS_MD_C
1254 *
1255 * Uncomment to enable the HMAC_DRBG random number geerator.
1256 */
1257#define MBEDTLS_HMAC_DRBG_C
1258
1259/**
1260 * \def MBEDTLS_MD_C
1261 *
1262 * Enable the generic message digest layer.
1263 *
1264 * Module: library/md.c
1265 * Caller:
1266 *
1267 * Uncomment to enable generic message digest wrappers.
1268 */
1269#define MBEDTLS_MD_C
1270
1271/**
1272 * \def MBEDTLS_MD2_C
1273 *
1274 * Enable the MD2 hash algorithm.
1275 *
1276 * Module: library/md2.c
1277 * Caller:
1278 *
1279 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1280 *
1281 * \warning MD2 is considered a weak message digest and its use constitutes a
1282 * security risk. If possible, we recommend avoiding dependencies on
1283 * it, and considering stronger message digests instead.
1284 *
1285 */
1286#define MBEDTLS_MD2_C
1287
1288/**
1289 * \def MBEDTLS_MD4_C
1290 *
1291 * Enable the MD4 hash algorithm.
1292 *
1293 * Module: library/md4.c
1294 * Caller:
1295 *
1296 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1297 *
1298 * \warning MD4 is considered a weak message digest and its use constitutes a
1299 * security risk. If possible, we recommend avoiding dependencies on
1300 * it, and considering stronger message digests instead.
1301 *
1302 */
1303#define MBEDTLS_MD4_C
1304
1305/**
1306 * \def MBEDTLS_MD5_C
1307 *
1308 * Enable the MD5 hash algorithm.
1309 *
1310 * Module: library/md5.c
1311 * Caller: library/md.c
1312 * library/pem.c
1313 * library/ssl_tls.c
1314 *
1315 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
1316 * depending on the handshake parameters. Further, it is used for checking
1317 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
1318 * encrypted keys.
1319 *
1320 * \warning MD5 is considered a weak message digest and its use constitutes a
1321 * security risk. If possible, we recommend avoiding dependencies on
1322 * it, and considering stronger message digests instead.
1323 *
1324 */
1325#define MBEDTLS_MD5_C
1326
1327/**
1328 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
1329 *
1330 * Enable the buffer allocator implementation that makes use of a (stack)
1331 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
1332 * calls)
1333 *
1334 * Module: library/memory_buffer_alloc.c
1335 *
1336 * Requires: MBEDTLS_PLATFORM_C
1337 * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
1338 *
1339 * Enable this module to enable the buffer memory allocator.
1340 */
1341//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
1342
1343/**
1344 * \def MBEDTLS_OID_C
1345 *
1346 * Enable the OID database.
1347 *
1348 * Module: library/oid.c
1349 * Caller: library/asn1write.c
1350 * library/pkcs5.c
1351 * library/pkparse.c
1352 * library/pkwrite.c
1353 * library/rsa.c
1354 * library/x509.c
1355 * library/x509_create.c
1356 * library/x509_crl.c
1357 * library/x509_crt.c
1358 * library/x509_csr.c
1359 * library/x509write_crt.c
1360 * library/x509write_csr.c
1361 *
1362 * This modules translates between OIDs and internal values.
1363 */
1364#define MBEDTLS_OID_C
1365
1366/**
1367 * \def MBEDTLS_PADLOCK_C
1368 *
1369 * Enable VIA Padlock support on x86.
1370 *
1371 * Module: library/padlock.c
1372 * Caller: library/aes.c
1373 *
1374 * Requires: MBEDTLS_HAVE_ASM
1375 *
1376 * This modules adds support for the VIA PadLock on x86.
1377 */
1378//#define MBEDTLS_PADLOCK_C
1379
1380/**
1381 * \def MBEDTLS_PEM_PARSE_C
1382 *
1383 * Enable PEM decoding / parsing.
1384 *
1385 * Module: library/pem.c
1386 * Caller: library/dhm.c
1387 * library/pkparse.c
1388 * library/x509_crl.c
1389 * library/x509_crt.c
1390 * library/x509_csr.c
1391 *
1392 * Requires: MBEDTLS_BASE64_C
1393 *
1394 * This modules adds support for decoding / parsing PEM files.
1395 */
1396#define MBEDTLS_PEM_PARSE_C
1397
1398/**
1399 * \def MBEDTLS_PEM_WRITE_C
1400 *
1401 * Enable PEM encoding / writing.
1402 *
1403 * Module: library/pem.c
1404 * Caller: library/pkwrite.c
1405 * library/x509write_crt.c
1406 * library/x509write_csr.c
1407 *
1408 * Requires: MBEDTLS_BASE64_C
1409 *
1410 * This modules adds support for encoding / writing PEM files.
1411 */
1412#define MBEDTLS_PEM_WRITE_C
1413
1414/**
1415 * \def MBEDTLS_PK_C
1416 *
1417 * Enable the generic public (asymetric) key layer.
1418 *
1419 * Module: library/pk.c
1420 * Caller: library/ssl_tls.c
1421 * library/ssl_cli.c
1422 * library/ssl_srv.c
1423 *
1424 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
1425 *
1426 * Uncomment to enable generic public key wrappers.
1427 */
1428#define MBEDTLS_PK_C
1429
1430/**
1431 * \def MBEDTLS_PK_PARSE_C
1432 *
1433 * Enable the generic public (asymetric) key parser.
1434 *
1435 * Module: library/pkparse.c
1436 * Caller: library/x509_crt.c
1437 * library/x509_csr.c
1438 *
1439 * Requires: MBEDTLS_PK_C
1440 *
1441 * Uncomment to enable generic public key parse functions.
1442 */
1443#define MBEDTLS_PK_PARSE_C
1444
1445/**
1446 * \def MBEDTLS_PK_WRITE_C
1447 *
1448 * Enable the generic public (asymetric) key writer.
1449 *
1450 * Module: library/pkwrite.c
1451 * Caller: library/x509write.c
1452 *
1453 * Requires: MBEDTLS_PK_C
1454 *
1455 * Uncomment to enable generic public key write functions.
1456 */
1457#define MBEDTLS_PK_WRITE_C
1458
1459/**
1460 * \def MBEDTLS_PKCS5_C
1461 *
1462 * Enable PKCS#5 functions.
1463 *
1464 * Module: library/pkcs5.c
1465 *
1466 * Requires: MBEDTLS_MD_C
1467 *
1468 * This module adds support for the PKCS#5 functions.
1469 */
1470#define MBEDTLS_PKCS5_C
1471
1472/**
1473 * \def MBEDTLS_PKCS11_C
1474 *
1475 * Enable wrapper for PKCS#11 smartcard support.
1476 *
1477 * Module: library/pkcs11.c
1478 * Caller: library/pk.c
1479 *
1480 * Requires: MBEDTLS_PK_C
1481 *
1482 * This module enables SSL/TLS PKCS #11 smartcard support.
1483 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1484 */
1485//#define MBEDTLS_PKCS11_C
1486
1487/**
1488 * \def MBEDTLS_PKCS12_C
1489 *
1490 * Enable PKCS#12 PBE functions.
1491 * Adds algorithms for parsing PKCS#8 encrypted private keys
1492 *
1493 * Module: library/pkcs12.c
1494 * Caller: library/pkparse.c
1495 *
1496 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
1497 * Can use: MBEDTLS_ARC4_C
1498 *
1499 * This module enables PKCS#12 functions.
1500 */
1501#define MBEDTLS_PKCS12_C
1502
1503/**
1504 * \def MBEDTLS_PLATFORM_C
1505 *
1506 * Enable the platform abstraction layer that allows you to re-assign
1507 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
1508 *
1509 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
1510 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
1511 * above to be specified at runtime or compile time respectively.
1512 *
1513 * \note This abstraction layer must be enabled on Windows (including MSYS2)
1514 * as other module rely on it for a fixed snprintf implementation.
1515 *
1516 * Module: library/platform.c
1517 * Caller: Most other .c files
1518 *
1519 * This module enables abstraction of common (libc) functions.
1520 */
1521#define MBEDTLS_PLATFORM_C
1522
1523/**
1524 * \def MBEDTLS_PSA_CRYPTO_C
1525 *
1526 * Enable the Platform Security Architecture cryptography API.
1527 *
1528 * Module: library/psa_crypto.c
1529 *
1530 * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C
1531 *
1532 */
1533#define MBEDTLS_PSA_CRYPTO_C
1534
1535/**
Darryl Greendb2b8db2018-06-15 13:06:04 +01001536 * \def MBEDTLS_PSA_CRYPTO_STORAGE_C
1537 *
1538 * Enable the Platform Security Architecture persistent key storage.
1539 *
1540 * Module: library/psa_crypto_storage.c
1541 *
Moran Peker46119562018-11-20 18:30:34 +02001542 * Requires: MBEDTLS_PSA_CRYPTO_C and one of either
1543 * MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C or MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
1544 * (but not both)
Darryl Greendb2b8db2018-06-15 13:06:04 +01001545 *
1546 */
1547#define MBEDTLS_PSA_CRYPTO_STORAGE_C
1548
1549/**
1550 * \def MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C
1551 *
1552 * Enable persistent key storage over files for the
1553 * Platform Security Architecture cryptography API.
1554 *
1555 * Module: library/psa_crypto_storage_file.c
1556 *
1557 * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_FS_IO
1558 *
1559 */
1560#define MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C
1561
1562/**
Moran Peker46119562018-11-20 18:30:34 +02001563 * \def MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
1564 *
1565 * Enable persistent key storage over PSA ITS for the
1566 * Platform Security Architecture cryptography API.
1567 *
1568 * Module: library/psa_crypto_storage_its.c
1569 *
1570 * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_HAS_ITS_IO
1571 *
1572 */
1573//#define MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
1574
1575/**
Gilles Peskined8374ba2018-02-16 20:36:55 +01001576 * \def MBEDTLS_RIPEMD160_C
1577 *
1578 * Enable the RIPEMD-160 hash algorithm.
1579 *
1580 * Module: library/ripemd160.c
1581 * Caller: library/md.c
1582 *
1583 */
1584#define MBEDTLS_RIPEMD160_C
1585
1586/**
1587 * \def MBEDTLS_RSA_C
1588 *
1589 * Enable the RSA public-key cryptosystem.
1590 *
1591 * Module: library/rsa.c
1592 * library/rsa_internal.c
1593 * Caller: library/ssl_cli.c
1594 * library/ssl_srv.c
1595 * library/ssl_tls.c
1596 * library/x509.c
1597 *
1598 * This module is used by the following key exchanges:
1599 * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
1600 *
1601 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
1602 */
1603#define MBEDTLS_RSA_C
1604
1605/**
1606 * \def MBEDTLS_SHA1_C
1607 *
1608 * Enable the SHA1 cryptographic hash algorithm.
1609 *
1610 * Module: library/sha1.c
1611 * Caller: library/md.c
1612 * library/ssl_cli.c
1613 * library/ssl_srv.c
1614 * library/ssl_tls.c
1615 * library/x509write_crt.c
1616 *
1617 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
1618 * depending on the handshake parameters, and for SHA1-signed certificates.
1619 *
1620 * \warning SHA-1 is considered a weak message digest and its use constitutes
1621 * a security risk. If possible, we recommend avoiding dependencies
1622 * on it, and considering stronger message digests instead.
1623 *
1624 */
1625#define MBEDTLS_SHA1_C
1626
1627/**
1628 * \def MBEDTLS_SHA256_C
1629 *
1630 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
1631 *
1632 * Module: library/sha256.c
1633 * Caller: library/entropy.c
1634 * library/md.c
1635 * library/ssl_cli.c
1636 * library/ssl_srv.c
1637 * library/ssl_tls.c
1638 *
1639 * This module adds support for SHA-224 and SHA-256.
1640 * This module is required for the SSL/TLS 1.2 PRF function.
1641 */
1642#define MBEDTLS_SHA256_C
1643
1644/**
1645 * \def MBEDTLS_SHA512_C
1646 *
1647 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
1648 *
1649 * Module: library/sha512.c
1650 * Caller: library/entropy.c
1651 * library/md.c
1652 * library/ssl_cli.c
1653 * library/ssl_srv.c
1654 *
1655 * This module adds support for SHA-384 and SHA-512.
1656 */
1657#define MBEDTLS_SHA512_C
1658
1659/**
1660 * \def MBEDTLS_THREADING_C
1661 *
1662 * Enable the threading abstraction layer.
1663 * By default mbed TLS assumes it is used in a non-threaded environment or that
1664 * contexts are not shared between threads. If you do intend to use contexts
1665 * between threads, you will need to enable this layer to prevent race
1666 * conditions. See also our Knowledge Base article about threading:
1667 * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
1668 *
1669 * Module: library/threading.c
1670 *
1671 * This allows different threading implementations (self-implemented or
1672 * provided).
1673 *
1674 * You will have to enable either MBEDTLS_THREADING_ALT or
1675 * MBEDTLS_THREADING_PTHREAD.
1676 *
1677 * Enable this layer to allow use of mutexes within mbed TLS
1678 */
1679//#define MBEDTLS_THREADING_C
1680
1681/**
1682 * \def MBEDTLS_VERSION_C
1683 *
1684 * Enable run-time version information.
1685 *
1686 * Module: library/version.c
1687 *
1688 * This module provides run-time version information.
1689 */
1690#define MBEDTLS_VERSION_C
1691
1692/**
1693 * \def MBEDTLS_XTEA_C
1694 *
1695 * Enable the XTEA block cipher.
1696 *
1697 * Module: library/xtea.c
1698 * Caller:
1699 */
1700#define MBEDTLS_XTEA_C
1701
1702/* \} name SECTION: mbed TLS modules */
1703
1704/**
1705 * \name SECTION: Module configuration options
1706 *
1707 * This section allows for the setting of module specific sizes and
1708 * configuration options. The default values are already present in the
1709 * relevant header files and should suffice for the regular use cases.
1710 *
1711 * Our advice is to enable options and change their values here
1712 * only if you have a good reason and know the consequences.
1713 *
1714 * Please check the respective header file for documentation on these
1715 * parameters (to prevent duplicate documentation).
1716 * \{
1717 */
1718
1719/* MPI / BIGNUM options */
1720//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1721//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
1722
1723/* CTR_DRBG options */
1724//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
1725//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1726//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1727//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1728//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1729
1730/* HMAC_DRBG options */
1731//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1732//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1733//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1734//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1735
1736/* ECP options */
1737//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
1738//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
1739//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
1740
1741/* Entropy options */
1742//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1743//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1744//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
1745
1746/* Memory buffer allocator options */
1747//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1748
1749/* Platform options */
1750//#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. */
1751//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
1752//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
1753//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
1754//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1755//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
1756//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
1757/* Note: your snprintf must correclty zero-terminate the buffer! */
1758//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
1759//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
1760//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
1761//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1762//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
1763//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
1764
1765/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
1766/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
1767//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
1768//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
1769//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
1770//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1771//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1772//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
1773//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
1774/* Note: your snprintf must correclty zero-terminate the buffer! */
1775//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
1776//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1777//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
1778
Gilles Peskine13187932018-06-19 11:49:23 +02001779/**
1780 * Uncomment the macro to let mbed TLS use your alternate implementation of
1781 * mbedtls_platform_zeroize(). This replaces the default implementation in
1782 * platform_util.c.
1783 *
1784 * mbedtls_platform_zeroize() is a widely used function across the library to
1785 * zero a block of memory. The implementation is expected to be secure in the
1786 * sense that it has been written to prevent the compiler from removing calls
1787 * to mbedtls_platform_zeroize() as part of redundant code elimination
1788 * optimizations. However, it is difficult to guarantee that calls to
1789 * mbedtls_platform_zeroize() will not be optimized by the compiler as older
1790 * versions of the C language standards do not provide a secure implementation
1791 * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to
1792 * configure their own implementation of mbedtls_platform_zeroize(), for
1793 * example by using directives specific to their compiler, features from newer
1794 * C standards (e.g using memset_s() in C11) or calling a secure memset() from
1795 * their system (e.g explicit_bzero() in BSD).
1796 */
1797//#define MBEDTLS_PLATFORM_ZEROIZE_ALT
1798
Gilles Peskined8374ba2018-02-16 20:36:55 +01001799/* \} name SECTION: Customisation configuration options */
1800
1801#include "mbedtls/check_config.h"
1802
1803#endif /* MBEDTLS_CONFIG_H */