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