blob: 9f063be729c67c288b1af49ee3f71e6d3520ac5c [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
Gilles Peskine66920ce2018-03-03 21:49:49 +01002 * \file config-psa-crypto.h
Paul Bakker5121ce52009-01-03 21:22:43 +00003 *
Gilles Peskine66920ce2018-03-03 21:49:49 +01004 * \brief Configuration with all cryptography features and no X.509 or TLS.
Paul Bakker37ca75d2011-01-06 12:28:03 +00005 *
Gilles Peskine66920ce2018-03-03 21:49:49 +01006 * This configuration is intended to prototype the PSA reference implementation.
Darryl Greena40a1012018-01-05 15:33:17 +00007 */
8/*
Thomas Fossati656864b2016-07-17 08:51:22 +01009 * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +020010 * 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.
Paul Bakkerb96f1542010-07-18 20:36:00 +000023 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000024 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnarde2b0efe2015-08-11 10:38:37 +020025 */
26
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020027#ifndef MBEDTLS_CONFIG_H
28#define MBEDTLS_CONFIG_H
Paul Bakker5121ce52009-01-03 21:22:43 +000029
Paul Bakkercce9d772011-11-18 14:26:47 +000030#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
Paul Bakker5121ce52009-01-03 21:22:43 +000031#define _CRT_SECURE_NO_DEPRECATE 1
32#endif
33
Paul Bakkerf3b86c12011-01-27 15:24:17 +000034/**
Paul Bakker0a62cd12011-01-21 11:00:08 +000035 * \name SECTION: System support
36 *
37 * This section sets system specific settings.
38 * \{
39 */
40
Paul Bakkerf3b86c12011-01-27 15:24:17 +000041/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020042 * \def MBEDTLS_HAVE_ASM
Paul Bakkerf3b86c12011-01-27 15:24:17 +000043 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020044 * The compiler has support for asm().
Paul Bakker68041ec2009-04-19 21:17:55 +000045 *
46 * Requires support for asm() in compiler.
47 *
48 * Used in:
Manuel Pégourié-Gonnard26b54fa2018-02-27 12:20:20 +010049 * library/aria.c
Paul Bakker68041ec2009-04-19 21:17:55 +000050 * library/timing.c
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000051 * include/mbedtls/bn_mul.h
Paul Bakker68041ec2009-04-19 21:17:55 +000052 *
Manuel Pégourié-Gonnard26b54fa2018-02-27 12:20:20 +010053 * Required by:
54 * MBEDTLS_AESNI_C
55 * MBEDTLS_PADLOCK_C
56 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020057 * Comment to disable the use of assembly code.
Paul Bakker5121ce52009-01-03 21:22:43 +000058 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020059#define MBEDTLS_HAVE_ASM
Paul Bakker5121ce52009-01-03 21:22:43 +000060
Paul Bakkerf3b86c12011-01-27 15:24:17 +000061/**
Gilles Peskineb1a977f2017-06-08 15:19:20 +020062 * \def MBEDTLS_NO_UDBL_DIVISION
63 *
64 * The platform lacks support for double-width integer division (64-bit
65 * division on a 32-bit platform, 128-bit division on a 64-bit platform).
66 *
67 * Used in:
68 * include/mbedtls/bignum.h
69 * library/bignum.c
70 *
71 * The bignum code uses double-width division to speed up some operations.
72 * Double-width division is often implemented in software that needs to
73 * be linked with the program. The presence of a double-width integer
74 * type is usually detected automatically through preprocessor macros,
75 * but the automatic detection cannot know whether the code needs to
76 * and can be linked with an implementation of division for that type.
77 * By default division is assumed to be usable if the type is present.
78 * Uncomment this option to prevent the use of double-width division.
79 *
80 * Note that division for the native integer type is always required.
81 * Furthermore, a 64-bit type is always required even on a 32-bit
Andres Amaya Garciac630ce62017-07-21 10:56:22 +010082 * platform, but it need not support multiplication or division. In some
83 * cases it is also desirable to disable some double-width operations. For
84 * example, if double-width division is implemented in software, disabling
85 * it can reduce code size in some embedded targets.
Gilles Peskineb1a977f2017-06-08 15:19:20 +020086 */
87//#define MBEDTLS_NO_UDBL_DIVISION
88
89/**
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +020090 * \def MBEDTLS_NO_64BIT_MULTIPLICATION
91 *
92 * The platform lacks support for 32x32 -> 64-bit multiplication.
93 *
94 * Used in:
95 * library/poly1305.c
96 *
97 * Some parts of the library may use multiplication of two unsigned 32-bit
98 * operands with a 64-bit result in order to speed up computations. On some
99 * platforms, this is not available in hardware and has to be implemented in
100 * software, usually in a library provided by the toolchain.
101 *
102 * Sometimes it is not desirable to have to link to that library. This option
103 * removes the dependency of that library on platforms that lack a hardware
104 * 64-bit multiplier by embedding a software implementation in Mbed TLS.
105 *
106 * Note that depending on the compiler, this may decrease performance compared
107 * to using the library function provided by the toolchain.
108 */
109//#define MBEDTLS_NO_64BIT_MULTIPLICATION
110
111/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200112 * \def MBEDTLS_HAVE_SSE2
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000113 *
Paul Bakkere23c3152012-10-01 14:42:47 +0000114 * CPU supports SSE2 instruction set.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000115 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000116 * Uncomment if the CPU supports SSE2 (IA-32 specific).
Paul Bakker5121ce52009-01-03 21:22:43 +0000117 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200118//#define MBEDTLS_HAVE_SSE2
Paul Bakkerfa9b1002013-07-03 15:31:03 +0200119
120/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200121 * \def MBEDTLS_PLATFORM_MEMORY
Paul Bakkerdefc0ca2014-02-04 17:30:24 +0100122 *
123 * Enable the memory allocation layer.
124 *
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +0200125 * By default mbed TLS uses the system-provided calloc() and free().
Paul Bakkerdefc0ca2014-02-04 17:30:24 +0100126 * This allows different allocators (self-implemented or provided) to be
127 * provided to the platform abstraction layer.
128 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200129 * Enabling MBEDTLS_PLATFORM_MEMORY without the
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +0200130 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
131 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
Rich Evans16f8cd82015-02-06 16:14:34 +0000132 * free() function pointer at runtime.
133 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200134 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +0200135 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
Rich Evans16f8cd82015-02-06 16:14:34 +0000136 * alternate function at compile time.
Paul Bakkerdefc0ca2014-02-04 17:30:24 +0100137 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200138 * Requires: MBEDTLS_PLATFORM_C
Paul Bakkerdefc0ca2014-02-04 17:30:24 +0100139 *
140 * Enable this layer to allow use of alternative memory allocators.
141 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200142//#define MBEDTLS_PLATFORM_MEMORY
Paul Bakkerdefc0ca2014-02-04 17:30:24 +0100143
144/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200145 * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
Paul Bakker088c5c52014-04-25 11:11:10 +0200146 *
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +0200147 * Do not assign standard functions in the platform layer (e.g. calloc() to
148 * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
Paul Bakker088c5c52014-04-25 11:11:10 +0200149 *
150 * This makes sure there are no linking errors on platforms that do not support
151 * these functions. You will HAVE to provide alternatives, either at runtime
152 * via the platform_set_xxx() functions or at compile time by setting
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200153 * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
154 * MBEDTLS_PLATFORM_XXX_MACRO.
Paul Bakker088c5c52014-04-25 11:11:10 +0200155 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200156 * Requires: MBEDTLS_PLATFORM_C
Paul Bakker088c5c52014-04-25 11:11:10 +0200157 *
158 * Uncomment to prevent default assignment of standard functions in the
159 * platform layer.
160 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200161//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
Paul Bakker088c5c52014-04-25 11:11:10 +0200162
163/**
Janos Follathc351d182016-03-21 08:43:59 +0000164 * \def MBEDTLS_PLATFORM_EXIT_ALT
Paul Bakker747a83a2014-02-01 22:50:07 +0100165 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100166 * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the
167 * function in the platform abstraction layer.
Paul Bakker747a83a2014-02-01 22:50:07 +0100168 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200169 * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will
170 * provide a function "mbedtls_platform_set_printf()" that allows you to set an
Paul Bakker747a83a2014-02-01 22:50:07 +0100171 * alternative printf function pointer.
172 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200173 * All these define require MBEDTLS_PLATFORM_C to be defined!
Paul Bakker747a83a2014-02-01 22:50:07 +0100174 *
Manuel Pégourié-Gonnard9db28872015-06-26 10:52:01 +0200175 * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
176 * it will be enabled automatically by check_config.h
177 *
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +0200178 * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200179 * MBEDTLS_PLATFORM_XXX_MACRO!
Rich Evans16f8cd82015-02-06 16:14:34 +0000180 *
Andres Amaya Garcia1e4ec662016-07-20 10:16:25 +0100181 * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME
182 *
Paul Bakker747a83a2014-02-01 22:50:07 +0100183 * Uncomment a macro to enable alternate implementation of specific base
184 * platform function
185 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200186//#define MBEDTLS_PLATFORM_EXIT_ALT
SimonBd5800b72016-04-26 07:43:27 +0100187//#define MBEDTLS_PLATFORM_TIME_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200188//#define MBEDTLS_PLATFORM_FPRINTF_ALT
189//#define MBEDTLS_PLATFORM_PRINTF_ALT
190//#define MBEDTLS_PLATFORM_SNPRINTF_ALT
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100191//#define MBEDTLS_PLATFORM_NV_SEED_ALT
Andres Amaya Garciad91f99f2017-07-18 10:23:04 +0100192//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100193
194/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200195 * \def MBEDTLS_DEPRECATED_WARNING
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100196 *
197 * Mark deprecated functions so that they generate a warning if used.
198 * Functions deprecated in one version will usually be removed in the next
199 * version. You can enable this to help you prepare the transition to a new
200 * major version by making sure your code is not using these functions.
201 *
202 * This only works with GCC and Clang. With other compilers, you may want to
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200203 * use MBEDTLS_DEPRECATED_REMOVED
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100204 *
205 * Uncomment to get warnings on using deprecated functions.
206 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200207//#define MBEDTLS_DEPRECATED_WARNING
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100208
209/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200210 * \def MBEDTLS_DEPRECATED_REMOVED
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100211 *
212 * Remove deprecated functions so that they generate an error if used.
213 * Functions deprecated in one version will usually be removed in the next
214 * version. You can enable this to help you prepare the transition to a new
215 * major version by making sure your code is not using these functions.
216 *
217 * Uncomment to get errors on using deprecated functions.
218 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200219//#define MBEDTLS_DEPRECATED_REMOVED
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100220
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200221/* \} name SECTION: System support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000222
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000223/**
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000224 * \name SECTION: mbed TLS feature support
Paul Bakker0a62cd12011-01-21 11:00:08 +0000225 *
226 * This section sets support for features that are or are not needed
227 * within the modules that are enabled.
228 * \{
229 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000230
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000231/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100232 * \def MBEDTLS_AES_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200233 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100234 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
Janos Follathb0697532016-08-18 12:38:46 +0100235 * alternate core implementation of a symmetric crypto, an arithmetic or hash
236 * module (e.g. platform specific assembly optimized implementations). Keep
237 * in mind that the function prototypes should remain the same.
Paul Bakker90995b52013-06-24 19:20:35 +0200238 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200239 * This replaces the whole module. If you only want to replace one of the
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200240 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200241 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200242 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
Janos Follathee782bc2016-11-07 15:41:26 +0000243 * provide the "struct mbedtls_aes_context" definition and omit the base
244 * function declarations and implementations. "aes_alt.h" will be included from
Paul Bakker90995b52013-06-24 19:20:35 +0200245 * "aes.h" to include the new function definitions.
246 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200247 * Uncomment a macro to enable alternate implementation of the corresponding
248 * module.
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100249 *
250 * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
251 * use constitutes a security risk. If possible, we recommend
252 * avoiding dependencies on them, and considering stronger message
253 * digests and ciphers instead.
254 *
Paul Bakker90995b52013-06-24 19:20:35 +0200255 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200256//#define MBEDTLS_AES_ALT
257//#define MBEDTLS_ARC4_ALT
Markku-Juhani O. Saarinen0fb47fe2017-12-01 15:41:38 +0000258//#define MBEDTLS_ARIA_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200259//#define MBEDTLS_BLOWFISH_ALT
260//#define MBEDTLS_CAMELLIA_ALT
Steven Cooreman222e2ff2017-04-04 11:37:15 +0200261//#define MBEDTLS_CCM_ALT
Daniel King34b822c2016-05-15 17:28:08 -0300262//#define MBEDTLS_CHACHA20_ALT
Manuel Pégourié-Gonnarde533b222018-06-04 12:23:19 +0200263//#define MBEDTLS_CHACHAPOLY_ALT
Steven Cooreman63342772017-04-04 11:47:16 +0200264//#define MBEDTLS_CMAC_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200265//#define MBEDTLS_DES_ALT
nirekh01d569ecf2018-01-09 16:43:21 +0000266//#define MBEDTLS_DHM_ALT
Hanno Becker616d1ca2018-01-24 10:25:05 +0000267//#define MBEDTLS_ECJPAKE_ALT
Jaeden Amero15263302017-09-21 12:53:48 +0100268//#define MBEDTLS_GCM_ALT
Ron Eldor466a57f2018-05-03 16:54:28 +0300269//#define MBEDTLS_NIST_KW_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200270//#define MBEDTLS_MD2_ALT
271//#define MBEDTLS_MD4_ALT
272//#define MBEDTLS_MD5_ALT
Daniel Kingadc32c02016-05-16 18:25:45 -0300273//#define MBEDTLS_POLY1305_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200274//#define MBEDTLS_RIPEMD160_ALT
Hanno Becker88683b22018-01-04 18:26:54 +0000275//#define MBEDTLS_RSA_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200276//#define MBEDTLS_SHA1_ALT
277//#define MBEDTLS_SHA256_ALT
278//#define MBEDTLS_SHA512_ALT
Hanno Becker88683b22018-01-04 18:26:54 +0000279//#define MBEDTLS_XTEA_ALT
Markku-Juhani O. Saarinen0fb47fe2017-12-01 15:41:38 +0000280
Janos Follathb0697532016-08-18 12:38:46 +0100281/*
282 * When replacing the elliptic curve module, pleace consider, that it is
283 * implemented with two .c files:
284 * - ecp.c
285 * - ecp_curves.c
Janos Follathee782bc2016-11-07 15:41:26 +0000286 * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT
287 * macros as described above. The only difference is that you have to make sure
288 * that you provide functionality for both .c files.
Janos Follathb0697532016-08-18 12:38:46 +0100289 */
290//#define MBEDTLS_ECP_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200291
292/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100293 * \def MBEDTLS_MD2_PROCESS_ALT
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200294 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100295 * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you
296 * alternate core implementation of symmetric crypto or hash function. Keep in
297 * mind that function prototypes should remain the same.
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200298 *
299 * This replaces only one function. The header file from mbed TLS is still
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200300 * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags.
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200301 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200302 * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will
303 * no longer provide the mbedtls_sha1_process() function, but it will still provide
304 * the other function (using your mbedtls_sha1_process() function) and the definition
305 * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200306 * with this definition.
307 *
Hanno Becker6d84ae72017-06-26 12:46:19 +0100308 * \note Because of a signature change, the core AES encryption and decryption routines are
309 * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt,
310 * respectively. When setting up alternative implementations, these functions should
311 * be overriden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt
Hanno Beckerca1cdb22017-07-20 09:50:59 +0100312 * must stay untouched.
Hanno Becker6d84ae72017-06-26 12:46:19 +0100313 *
314 * \note If you use the AES_xxx_ALT macros, then is is recommended to also set
315 * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
316 * tables.
Manuel Pégourié-Gonnard31993f22015-05-12 15:41:08 +0200317 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200318 * Uncomment a macro to enable alternate implementation of the corresponding
319 * function.
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100320 *
321 * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use
322 * constitutes a security risk. If possible, we recommend avoiding
323 * dependencies on them, and considering stronger message digests
324 * and ciphers instead.
325 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200326 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200327//#define MBEDTLS_MD2_PROCESS_ALT
328//#define MBEDTLS_MD4_PROCESS_ALT
329//#define MBEDTLS_MD5_PROCESS_ALT
330//#define MBEDTLS_RIPEMD160_PROCESS_ALT
331//#define MBEDTLS_SHA1_PROCESS_ALT
332//#define MBEDTLS_SHA256_PROCESS_ALT
333//#define MBEDTLS_SHA512_PROCESS_ALT
Manuel Pégourié-Gonnard70a50102015-05-12 15:02:45 +0200334//#define MBEDTLS_DES_SETKEY_ALT
335//#define MBEDTLS_DES_CRYPT_ECB_ALT
336//#define MBEDTLS_DES3_CRYPT_ECB_ALT
Manuel Pégourié-Gonnard31993f22015-05-12 15:41:08 +0200337//#define MBEDTLS_AES_SETKEY_ENC_ALT
338//#define MBEDTLS_AES_SETKEY_DEC_ALT
339//#define MBEDTLS_AES_ENCRYPT_ALT
340//#define MBEDTLS_AES_DECRYPT_ALT
Ron Eldora84c1cb2017-10-10 19:04:27 +0300341//#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
Ron Eldor3226d362017-10-12 14:17:48 +0300342//#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT
Ron Eldor314adb62017-10-10 18:28:25 +0300343//#define MBEDTLS_ECDSA_VERIFY_ALT
344//#define MBEDTLS_ECDSA_SIGN_ALT
345//#define MBEDTLS_ECDSA_GENKEY_ALT
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200346
347/**
Janos Follathc44ab972016-11-18 16:38:23 +0000348 * \def MBEDTLS_ECP_INTERNAL_ALT
349 *
350 * Expose a part of the internal interface of the Elliptic Curve Point module.
Janos Follathb0697532016-08-18 12:38:46 +0100351 *
352 * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your
Janos Follath372697b2016-10-28 16:53:11 +0100353 * alternative core implementation of elliptic curve arithmetic. Keep in mind
354 * that function prototypes should remain the same.
Janos Follathb0697532016-08-18 12:38:46 +0100355 *
356 * This partially replaces one function. The header file from mbed TLS is still
357 * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation
358 * is still present and it is used for group structures not supported by the
359 * alternative.
360 *
Janos Follathc44ab972016-11-18 16:38:23 +0000361 * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT
362 * and implementing the following functions:
363 * unsigned char mbedtls_internal_ecp_grp_capable(
364 * const mbedtls_ecp_group *grp )
365 * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp )
366 * void mbedtls_internal_ecp_deinit( const mbedtls_ecp_group *grp )
367 * The mbedtls_internal_ecp_grp_capable function should return 1 if the
368 * replacement functions implement arithmetic for the given group and 0
369 * otherwise.
370 * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_deinit are
371 * called before and after each point operation and provide an opportunity to
372 * implement optimized set up and tear down instructions.
Janos Follathb0697532016-08-18 12:38:46 +0100373 *
Janos Follathc44ab972016-11-18 16:38:23 +0000374 * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and
Janos Follath4d9c69d2016-11-01 13:27:03 +0000375 * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac
Janos Follathc44ab972016-11-18 16:38:23 +0000376 * function, but will use your mbedtls_internal_ecp_double_jac if the group is
377 * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when
378 * receives it as an argument). If the group is not supported then the original
Janos Follathee782bc2016-11-07 15:41:26 +0000379 * implementation is used. The other functions and the definition of
380 * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your
Janos Follathc44ab972016-11-18 16:38:23 +0000381 * implementation of mbedtls_internal_ecp_double_jac and
382 * mbedtls_internal_ecp_grp_capable must be compatible with this definition.
Janos Follathb0697532016-08-18 12:38:46 +0100383 *
384 * Uncomment a macro to enable alternate implementation of the corresponding
385 * function.
386 */
387/* Required for all the functions in this section */
Janos Follathc44ab972016-11-18 16:38:23 +0000388//#define MBEDTLS_ECP_INTERNAL_ALT
Janos Follathb0697532016-08-18 12:38:46 +0100389/* Support for Weierstrass curves with Jacobi representation */
390//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
391//#define MBEDTLS_ECP_ADD_MIXED_ALT
392//#define MBEDTLS_ECP_DOUBLE_JAC_ALT
393//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
394//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
395/* Support for curves with Montgomery arithmetic */
396//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
397//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
398//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
399
400/**
Simon Butcherab5df402016-06-11 02:31:21 +0100401 * \def MBEDTLS_TEST_NULL_ENTROPY
Janos Follath53de7842016-06-08 15:29:18 +0100402 *
Simon Butcherab5df402016-06-11 02:31:21 +0100403 * Enables testing and use of mbed TLS without any configured entropy sources.
404 * This permits use of the library on platforms before an entropy source has
405 * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the
406 * MBEDTLS_ENTROPY_NV_SEED switches).
407 *
408 * WARNING! This switch MUST be disabled in production builds, and is suitable
409 * only for development.
410 * Enabling the switch negates any security provided by the library.
Janos Follath53de7842016-06-08 15:29:18 +0100411 *
Janos Follathf93b8bc2016-06-09 13:54:15 +0100412 * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
413 *
Janos Follath53de7842016-06-08 15:29:18 +0100414 */
Simon Butcherab5df402016-06-11 02:31:21 +0100415//#define MBEDTLS_TEST_NULL_ENTROPY
Janos Follath53de7842016-06-08 15:29:18 +0100416
417/**
Manuel Pégourié-Gonnard8ba88f02015-06-22 12:14:20 +0200418 * \def MBEDTLS_ENTROPY_HARDWARE_ALT
Manuel Pégourié-Gonnard3f77dfb2015-06-19 10:06:21 +0200419 *
420 * Uncomment this macro to let mbed TLS use your own implementation of a
421 * hardware entropy collector.
422 *
423 * Your function must be called \c mbedtls_hardware_poll(), have the same
424 * prototype as declared in entropy_poll.h, and accept NULL as first argument.
425 *
426 * Uncomment to use your own hardware entropy collector.
427 */
428//#define MBEDTLS_ENTROPY_HARDWARE_ALT
429
430/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200431 * \def MBEDTLS_AES_ROM_TABLES
Paul Bakker15566e42011-04-24 21:19:15 +0000432 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100433 * Use precomputed AES tables stored in ROM.
Paul Bakker15566e42011-04-24 21:19:15 +0000434 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100435 * Uncomment this macro to use precomputed AES tables stored in ROM.
436 * Comment this macro to generate AES tables in RAM at runtime.
437 *
Hanno Becker4c1dc3c2018-03-27 16:52:03 +0100438 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
439 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
Hanno Becker6a92ce62018-03-28 11:42:05 +0100440 * initialization time before the first AES operation can be performed.
441 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
442 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
443 * performance if ROM access is slower than RAM access.
Hanno Becker177d3cf2017-06-07 15:52:48 +0100444 *
445 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
446 *
Paul Bakker15566e42011-04-24 21:19:15 +0000447 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200448//#define MBEDTLS_AES_ROM_TABLES
Paul Bakker15566e42011-04-24 21:19:15 +0000449
450/**
Hanno Becker177d3cf2017-06-07 15:52:48 +0100451 * \def MBEDTLS_AES_FEWER_TABLES
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200452 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100453 * Use less ROM/RAM for AES tables.
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200454 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100455 * Uncommenting this macro omits 75% of the AES tables from
456 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
457 * by computing their values on the fly during operations
458 * (the tables are entry-wise rotations of one another).
459 *
460 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
Hanno Becker08a5c182017-06-19 16:33:58 +0100461 * by ~6kb but at the cost of more arithmetic operations during
Hanno Becker177d3cf2017-06-07 15:52:48 +0100462 * runtime. Specifically, one has to compare 4 accesses within
463 * different tables to 4 accesses with additional arithmetic
464 * operations within the same table. The performance gain/loss
465 * depends on the system and memory details.
466 *
467 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
468 *
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200469 */
Hanno Becker177d3cf2017-06-07 15:52:48 +0100470//#define MBEDTLS_AES_FEWER_TABLES
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200471
472/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200473 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
Manuel Pégourié-Gonnard62edcc82015-04-03 16:28:19 +0200474 *
475 * Use less ROM for the Camellia implementation (saves about 768 bytes).
476 *
477 * Uncomment this macro to use less memory for Camellia.
478 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200479//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
Manuel Pégourié-Gonnard62edcc82015-04-03 16:28:19 +0200480
481/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200482 * \def MBEDTLS_CIPHER_MODE_CBC
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200483 *
484 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
485 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200486#define MBEDTLS_CIPHER_MODE_CBC
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200487
488/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200489 * \def MBEDTLS_CIPHER_MODE_CFB
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000490 *
491 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
492 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200493#define MBEDTLS_CIPHER_MODE_CFB
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000494
495/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200496 * \def MBEDTLS_CIPHER_MODE_CTR
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000497 *
498 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
499 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200500#define MBEDTLS_CIPHER_MODE_CTR
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000501
502/**
Jaeden Ameroff2f4932018-06-14 11:38:50 +0100503 * \def MBEDTLS_CIPHER_MODE_OFB
504 *
505 * Enable Output Feedback mode (OFB) for symmetric ciphers.
506 */
507#define MBEDTLS_CIPHER_MODE_OFB
508
509/**
510 * \def MBEDTLS_CIPHER_MODE_XTS
511 *
512 * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES.
513 */
514#define MBEDTLS_CIPHER_MODE_XTS
515
516/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200517 * \def MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +0000518 *
519 * Enable NULL cipher.
520 * Warning: Only do so when you know what you are doing. This allows for
521 * encryption or channels without any security!
522 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200523 * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable
Paul Bakkerfab5c822012-02-06 16:45:10 +0000524 * the following ciphersuites:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200525 * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
526 * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
527 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
528 * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
529 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
530 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
531 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
532 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
533 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
534 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
535 * MBEDTLS_TLS_RSA_WITH_NULL_SHA256
536 * MBEDTLS_TLS_RSA_WITH_NULL_SHA
537 * MBEDTLS_TLS_RSA_WITH_NULL_MD5
538 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384
539 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256
540 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA
541 * MBEDTLS_TLS_PSK_WITH_NULL_SHA384
542 * MBEDTLS_TLS_PSK_WITH_NULL_SHA256
543 * MBEDTLS_TLS_PSK_WITH_NULL_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000544 *
545 * Uncomment this macro to enable the NULL cipher and ciphersuites
Paul Bakkerfab5c822012-02-06 16:45:10 +0000546 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200547//#define MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +0000548
549/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100550 * \def MBEDTLS_CIPHER_PADDING_PKCS7
Paul Bakker48e93c82013-08-14 12:21:18 +0200551 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100552 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
553 * specific padding modes in the cipher layer with cipher modes that support
554 * padding (e.g. CBC)
Paul Bakker48e93c82013-08-14 12:21:18 +0200555 *
556 * If you disable all padding modes, only full blocks can be used with CBC.
557 *
558 * Enable padding modes in the cipher layer.
559 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200560#define MBEDTLS_CIPHER_PADDING_PKCS7
561#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
562#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
563#define MBEDTLS_CIPHER_PADDING_ZEROS
Paul Bakker48e93c82013-08-14 12:21:18 +0200564
565/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100566 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200567 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100568 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
569 * module. By default all supported curves are enabled.
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200570 *
571 * Comment macros to disable the curve and functions for it
572 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200573#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
574#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
575#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
576#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
577#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
578#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
579#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
580#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
581#define MBEDTLS_ECP_DP_BP256R1_ENABLED
582#define MBEDTLS_ECP_DP_BP384R1_ENABLED
583#define MBEDTLS_ECP_DP_BP512R1_ENABLED
Manuel Pégourié-Gonnard07894332015-06-23 00:18:41 +0200584#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
Nicholas Wilson08f3ef12015-11-10 13:10:01 +0000585#define MBEDTLS_ECP_DP_CURVE448_ENABLED
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200586
587/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200588 * \def MBEDTLS_ECP_NIST_OPTIM
Manuel Pégourié-Gonnardc04c5302013-10-23 16:11:52 +0200589 *
590 * Enable specific 'modulo p' routines for each NIST prime.
591 * Depending on the prime and architecture, makes operations 4 to 8 times
592 * faster on the corresponding curve.
593 *
594 * Comment this macro to disable NIST curves optimisation.
595 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200596#define MBEDTLS_ECP_NIST_OPTIM
Manuel Pégourié-Gonnardc04c5302013-10-23 16:11:52 +0200597
598/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200599 * \def MBEDTLS_ECDSA_DETERMINISTIC
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100600 *
601 * Enable deterministic ECDSA (RFC 6979).
602 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
603 * may result in a compromise of the long-term signing key. This is avoided by
604 * the deterministic variant.
605 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200606 * Requires: MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard5b1a5732014-01-07 16:46:17 +0100607 *
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100608 * Comment this macro to disable deterministic ECDSA.
609 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200610#define MBEDTLS_ECDSA_DETERMINISTIC
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100611
612/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200613 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
Manuel Pégourié-Gonnard6fac3512014-03-19 16:39:52 +0100614 *
615 * Enhance support for reading EC keys using variants of SEC1 not allowed by
616 * RFC 5915 and RFC 5480.
617 *
618 * Currently this means parsing the SpecifiedECDomain choice of EC
619 * parameters (only known groups are supported, not arbitrary domains, to
620 * avoid validation issues).
621 *
622 * Disable if you only need to support RFC 5915 + 5480 key formats.
623 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200624#define MBEDTLS_PK_PARSE_EC_EXTENDED
Manuel Pégourié-Gonnard6fac3512014-03-19 16:39:52 +0100625
626/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200627 * \def MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100628 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200629 * Enable a dummy error function to make use of mbedtls_strerror() in
630 * third party libraries easier when MBEDTLS_ERROR_C is disabled
631 * (no effect when MBEDTLS_ERROR_C is enabled).
Manuel Pégourié-Gonnarddc16aa72014-06-25 12:55:12 +0200632 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200633 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
634 * not using mbedtls_strerror() or error_strerror() in your application.
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100635 *
636 * Disable if you run into name conflicts and want to really remove the
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200637 * mbedtls_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100638 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200639#define MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100640
641/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200642 * \def MBEDTLS_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000643 *
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200644 * Enable the prime-number generation code.
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200645 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200646 * Requires: MBEDTLS_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000647 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200648#define MBEDTLS_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000649
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000650/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200651 * \def MBEDTLS_FS_IO
Paul Bakker335db3f2011-04-25 15:28:35 +0000652 *
653 * Enable functions that use the filesystem.
654 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200655#define MBEDTLS_FS_IO
Paul Bakker335db3f2011-04-25 15:28:35 +0000656
657/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200658 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
Paul Bakker43655f42011-12-15 20:11:16 +0000659 *
660 * Do not add default entropy sources. These are the platform specific,
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200661 * mbedtls_timing_hardclock and HAVEGE based poll functions.
Paul Bakker43655f42011-12-15 20:11:16 +0000662 *
Shuo Chen95a0d112014-04-04 21:04:40 -0700663 * This is useful to have more control over the added entropy sources in an
Paul Bakker43655f42011-12-15 20:11:16 +0000664 * application.
665 *
666 * Uncomment this macro to prevent loading of default entropy functions.
Paul Bakker43655f42011-12-15 20:11:16 +0000667 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200668//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
Paul Bakker43655f42011-12-15 20:11:16 +0000669
670/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200671 * \def MBEDTLS_NO_PLATFORM_ENTROPY
Paul Bakker6083fd22011-12-03 21:45:14 +0000672 *
673 * Do not use built-in platform entropy functions.
674 * This is useful if your platform does not support
675 * standards like the /dev/urandom or Windows CryptoAPI.
676 *
677 * Uncomment this macro to disable the built-in platform entropy functions.
Paul Bakker6083fd22011-12-03 21:45:14 +0000678 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200679//#define MBEDTLS_NO_PLATFORM_ENTROPY
Paul Bakker6083fd22011-12-03 21:45:14 +0000680
681/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200682 * \def MBEDTLS_ENTROPY_FORCE_SHA256
Paul Bakker2ceda572014-02-06 15:55:25 +0100683 *
684 * Force the entropy accumulator to use a SHA-256 accumulator instead of the
685 * default SHA-512 based one (if both are available).
686 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200687 * Requires: MBEDTLS_SHA256_C
Paul Bakker2ceda572014-02-06 15:55:25 +0100688 *
689 * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
690 * if you have performance concerns.
691 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200692 * This option is only useful if both MBEDTLS_SHA256_C and
693 * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
Paul Bakker2ceda572014-02-06 15:55:25 +0100694 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200695//#define MBEDTLS_ENTROPY_FORCE_SHA256
Paul Bakker2ceda572014-02-06 15:55:25 +0100696
697/**
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100698 * \def MBEDTLS_ENTROPY_NV_SEED
699 *
700 * Enable the non-volatile (NV) seed file-based entropy source.
701 * (Also enables the NV seed read/write functions in the platform layer)
702 *
703 * This is crucial (if not required) on systems that do not have a
704 * cryptographic entropy source (in hardware or kernel) available.
705 *
706 * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
707 *
Paul Bakker71a597a2016-06-07 10:59:03 +0100708 * \note The read/write functions that are used by the entropy source are
709 * determined in the platform layer, and can be modified at runtime and/or
710 * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
711 *
712 * \note If you use the default implementation functions that read a seedfile
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100713 * with regular fopen(), please make sure you make a seedfile with the
714 * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
715 * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
Paul Bakker71a597a2016-06-07 10:59:03 +0100716 * and written to or you will get an entropy source error! The default
717 * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
718 * bytes from the file.
719 *
720 * \note The entropy collector will write to the seed file before entropy is
721 * given to an external source, to update it.
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100722 */
723//#define MBEDTLS_ENTROPY_NV_SEED
724
725/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200726 * \def MBEDTLS_MEMORY_DEBUG
Paul Bakker6e339b52013-07-03 13:37:05 +0200727 *
728 * Enable debugging of buffer allocator memory issues. Automatically prints
729 * (to stderr) all (fatal) messages on memory allocation issues. Enables
730 * function for 'debug output' of allocated memory.
731 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200732 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +0200733 *
734 * Uncomment this macro to let the buffer allocator print out error messages.
Paul Bakkera7ea6a52013-10-15 11:55:10 +0200735 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200736//#define MBEDTLS_MEMORY_DEBUG
Paul Bakker6e339b52013-07-03 13:37:05 +0200737
738/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200739 * \def MBEDTLS_MEMORY_BACKTRACE
Paul Bakker6e339b52013-07-03 13:37:05 +0200740 *
741 * Include backtrace information with each allocated block.
742 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200743 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +0200744 * GLIBC-compatible backtrace() an backtrace_symbols() support
745 *
746 * Uncomment this macro to include backtrace information
Paul Bakker6e339b52013-07-03 13:37:05 +0200747 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200748//#define MBEDTLS_MEMORY_BACKTRACE
Paul Bakker6e339b52013-07-03 13:37:05 +0200749
750/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200751 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +0200752 *
753 * Support external private RSA keys (eg from a HSM) in the PK layer.
754 *
755 * Comment this macro to disable support for external private RSA keys.
756 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200757#define MBEDTLS_PK_RSA_ALT_SUPPORT
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +0200758
759/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200760 * \def MBEDTLS_PKCS1_V15
Paul Bakker48377d92013-08-30 12:06:24 +0200761 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200762 * Enable support for PKCS#1 v1.5 encoding.
763 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200764 * Requires: MBEDTLS_RSA_C
Paul Bakker48377d92013-08-30 12:06:24 +0200765 *
Paul Bakker48377d92013-08-30 12:06:24 +0200766 * This enables support for PKCS#1 v1.5 operations.
767 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200768#define MBEDTLS_PKCS1_V15
Paul Bakker48377d92013-08-30 12:06:24 +0200769
770/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200771 * \def MBEDTLS_PKCS1_V21
Paul Bakker9dcc3222011-03-08 14:16:06 +0000772 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200773 * Enable support for PKCS#1 v2.1 encoding.
774 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200775 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
Paul Bakker5690efc2011-05-26 13:16:06 +0000776 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000777 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
778 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200779#define MBEDTLS_PKCS1_V21
Paul Bakker9dcc3222011-03-08 14:16:06 +0000780
781/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200782 * \def MBEDTLS_RSA_NO_CRT
Paul Bakker0216cc12011-03-26 13:40:23 +0000783 *
Gilles Peskine66920ce2018-03-03 21:49:49 +0100784 * Do not use the Chinese Remainder Theorem for the RSA private operation.
Paul Bakker0216cc12011-03-26 13:40:23 +0000785 *
786 * Uncomment this macro to disable the use of CRT in RSA.
787 *
Paul Bakker0216cc12011-03-26 13:40:23 +0000788 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200789//#define MBEDTLS_RSA_NO_CRT
Paul Bakker15566e42011-04-24 21:19:15 +0000790
791/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200792 * \def MBEDTLS_SELF_TEST
Paul Bakker15566e42011-04-24 21:19:15 +0000793 *
794 * Enable the checkup functions (*_self_test).
795 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200796#define MBEDTLS_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000797
798/**
Manuel Pégourié-Gonnardeb0d8702015-05-28 12:54:04 +0200799 * \def MBEDTLS_SHA256_SMALLER
800 *
801 * Enable an implementation of SHA-256 that has lower ROM footprint but also
802 * lower performance.
803 *
804 * The default implementation is meant to be a reasonnable compromise between
805 * performance and size. This version optimizes more aggressively for size at
806 * the expense of performance. Eg on Cortex-M4 it reduces the size of
807 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
808 * 30%.
809 *
810 * Uncomment to enable the smaller implementation of SHA256.
811 */
812//#define MBEDTLS_SHA256_SMALLER
813
814/**
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200815 * \def MBEDTLS_SSL_ASYNC_PRIVATE
816 *
817 * Enable asynchronous external private key operations in SSL. This allows
818 * you to configure an SSL connection to call an external cryptographic
819 * module to perform private key operations instead of performing the
820 * operation inside the library.
821 *
822 */
Jaeden Amerod9c71da2018-06-15 20:31:26 +0100823//#define MBEDTLS_SSL_ASYNC_PRIVATE
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200824
825/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200826 * \def MBEDTLS_THREADING_ALT
Paul Bakker2466d932013-09-28 14:40:38 +0200827 *
828 * Provide your own alternate threading implementation.
829 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200830 * Requires: MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +0200831 *
832 * Uncomment this to allow your own alternate threading implementation.
Paul Bakker2466d932013-09-28 14:40:38 +0200833 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200834//#define MBEDTLS_THREADING_ALT
Paul Bakker2466d932013-09-28 14:40:38 +0200835
836/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200837 * \def MBEDTLS_THREADING_PTHREAD
Paul Bakker2466d932013-09-28 14:40:38 +0200838 *
839 * Enable the pthread wrapper layer for the threading layer.
840 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200841 * Requires: MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +0200842 *
843 * Uncomment this to enable pthread mutexes.
Paul Bakker2466d932013-09-28 14:40:38 +0200844 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200845//#define MBEDTLS_THREADING_PTHREAD
Paul Bakker2466d932013-09-28 14:40:38 +0200846
847/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200848 * \def MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200849 *
850 * Allow run-time checking of compile-time enabled features. Thus allowing users
851 * to check at run-time if the library is for instance compiled with threading
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200852 * support via mbedtls_version_check_feature().
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200853 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200854 * Requires: MBEDTLS_VERSION_C
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200855 *
856 * Comment this to disable run-time checking and save ROM space
857 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200858#define MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200859
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000860/* \} name SECTION: mbed TLS feature support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000861
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000862/**
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000863 * \name SECTION: mbed TLS modules
Paul Bakker0a62cd12011-01-21 11:00:08 +0000864 *
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000865 * This section enables or disables entire modules in mbed TLS
Paul Bakker0a62cd12011-01-21 11:00:08 +0000866 * \{
867 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000868
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000869/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200870 * \def MBEDTLS_AESNI_C
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +0100871 *
872 * Enable AES-NI support on x86-64.
873 *
874 * Module: library/aesni.c
875 * Caller: library/aes.c
876 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200877 * Requires: MBEDTLS_HAVE_ASM
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +0100878 *
879 * This modules adds support for the AES-NI instructions on x86-64
880 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200881#define MBEDTLS_AESNI_C
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +0100882
883/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200884 * \def MBEDTLS_AES_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000885 *
886 * Enable the AES block cipher.
887 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000888 * Module: library/aes.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +0100889 * Caller: library/cipher.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000890 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000891 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000892 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000893 * This module enables the following ciphersuites (if other requisites are
894 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200895 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
896 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
897 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
898 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
899 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
900 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
901 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
902 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
903 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
904 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
905 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
906 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
907 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
908 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
909 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
910 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
911 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
912 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
913 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
914 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
915 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
916 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
917 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
918 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
919 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
920 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
921 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
922 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
923 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
924 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
925 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
926 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
927 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
928 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
929 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
930 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
931 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
932 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
933 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
934 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
935 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
936 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
937 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
938 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
939 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
940 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
941 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
942 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
943 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
944 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
945 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
946 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
947 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
948 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
949 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
950 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
951 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
952 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100953 *
Paul Bakkercff68422013-09-15 20:43:33 +0200954 * PEM_PARSE uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000955 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200956#define MBEDTLS_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000957
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000958/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200959 * \def MBEDTLS_ARC4_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000960 *
961 * Enable the ARCFOUR stream cipher.
962 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000963 * Module: library/arc4.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +0100964 * Caller: library/cipher.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000965 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100966 * This module enables the following ciphersuites (if other requisites are
967 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200968 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
969 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
970 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
971 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
972 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
973 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
974 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
975 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
976 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
977 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100978 *
979 * \warning ARC4 is considered a weak cipher and its use constitutes a
980 * security risk. If possible, we recommend avoidng dependencies on
981 * it, and considering stronger ciphers instead.
982 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000983 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200984#define MBEDTLS_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000985
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000986/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200987 * \def MBEDTLS_ASN1_PARSE_C
Paul Bakkerefc30292011-11-10 14:43:23 +0000988 *
989 * Enable the generic ASN1 parser.
990 *
991 * Module: library/asn1.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200992 * Caller: library/x509.c
993 * library/dhm.c
994 * library/pkcs12.c
995 * library/pkcs5.c
996 * library/pkparse.c
Paul Bakkerefc30292011-11-10 14:43:23 +0000997 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200998#define MBEDTLS_ASN1_PARSE_C
Paul Bakkerefc30292011-11-10 14:43:23 +0000999
1000/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001001 * \def MBEDTLS_ASN1_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001002 *
1003 * Enable the generic ASN1 writer.
1004 *
1005 * Module: library/asn1write.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001006 * Caller: library/ecdsa.c
1007 * library/pkwrite.c
1008 * library/x509_create.c
1009 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001010 * library/x509write_csr.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001011 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001012#define MBEDTLS_ASN1_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001013
1014/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001015 * \def MBEDTLS_BASE64_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001016 *
1017 * Enable the Base64 module.
1018 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001019 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001020 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001021 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001022 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +00001023 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001024#define MBEDTLS_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001025
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001026/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001027 * \def MBEDTLS_BIGNUM_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001028 *
Paul Bakker9a736322012-11-14 12:39:52 +00001029 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001030 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001031 * Module: library/bignum.c
1032 * Caller: library/dhm.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001033 * library/ecp.c
Manuel Pégourié-Gonnardbf319772014-06-25 13:00:17 +02001034 * library/ecdsa.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001035 * library/rsa.c
Hanno Beckera565f542017-10-11 11:00:19 +01001036 * library/rsa_internal.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001037 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001038 *
Manuel Pégourié-Gonnardbf319772014-06-25 13:00:17 +02001039 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
Paul Bakker5121ce52009-01-03 21:22:43 +00001040 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001041#define MBEDTLS_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001042
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001043/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001044 * \def MBEDTLS_BLOWFISH_C
Paul Bakkera9379c02012-07-04 11:02:11 +00001045 *
1046 * Enable the Blowfish block cipher.
1047 *
1048 * Module: library/blowfish.c
1049 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001050#define MBEDTLS_BLOWFISH_C
Paul Bakkera9379c02012-07-04 11:02:11 +00001051
1052/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001053 * \def MBEDTLS_CAMELLIA_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001054 *
1055 * Enable the Camellia block cipher.
1056 *
Paul Bakker38119b12009-01-10 23:31:23 +00001057 * Module: library/camellia.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +01001058 * Caller: library/cipher.c
Paul Bakker38119b12009-01-10 23:31:23 +00001059 *
Paul Bakker645ce3a2012-10-31 12:32:41 +00001060 * This module enables the following ciphersuites (if other requisites are
1061 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001062 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1063 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1064 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
1065 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
1066 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1067 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1068 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
1069 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
1070 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1071 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1072 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1073 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1074 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
1075 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
1076 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
1077 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1078 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1079 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1080 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1081 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1082 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1083 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1084 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
1085 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1086 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1087 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
1088 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1089 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1090 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1091 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
1092 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
1093 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
1094 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
1095 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
1096 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
1097 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
1098 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
1099 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
1100 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
1101 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
1102 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
1103 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +00001104 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001105#define MBEDTLS_CAMELLIA_C
Paul Bakker38119b12009-01-10 23:31:23 +00001106
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001107/**
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001108 * \def MBEDTLS_ARIA_C
1109 *
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001110 * Enable the ARIA block cipher.
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001111 *
1112 * Module: library/aria.c
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001113 * Caller: library/cipher.c
1114 *
1115 * This module enables the following ciphersuites (if other requisites are
1116 * enabled as well):
1117 *
1118 * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256
1119 * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384
1120 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256
1121 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384
1122 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256
1123 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384
1124 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256
1125 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384
1126 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256
1127 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384
1128 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256
1129 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384
1130 * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256
1131 * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384
1132 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256
1133 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384
1134 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256
1135 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384
1136 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256
1137 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384
1138 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256
1139 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384
1140 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256
1141 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384
1142 * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256
1143 * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384
1144 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256
1145 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384
1146 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256
1147 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384
1148 * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256
1149 * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384
1150 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256
1151 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384
1152 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256
1153 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384
1154 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256
1155 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001156 */
Manuel Pégourié-Gonnard2268b962018-02-27 12:22:36 +01001157//#define MBEDTLS_ARIA_C
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001158
1159/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001160 * \def MBEDTLS_CCM_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001161 *
1162 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
1163 *
1164 * Module: library/ccm.c
1165 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001166 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001167 *
1168 * This module enables the AES-CCM ciphersuites, if other requisites are
1169 * enabled as well.
1170 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001171#define MBEDTLS_CCM_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001172
1173/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001174 * \def MBEDTLS_CERTS_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001175 *
1176 * Enable the test certificates.
1177 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001178 * Module: library/certs.c
1179 * Caller:
1180 *
1181 * This module is used for testing (ssl_client/server).
1182 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001183#define MBEDTLS_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001184
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001185/**
Daniel King34b822c2016-05-15 17:28:08 -03001186 * \def MBEDTLS_CHACHA20_C
1187 *
1188 * Enable the ChaCha20 stream cipher.
1189 *
1190 * Module: library/chacha20.c
1191 */
1192#define MBEDTLS_CHACHA20_C
1193
1194/**
Manuel Pégourié-Gonnarde533b222018-06-04 12:23:19 +02001195 * \def MBEDTLS_CHACHAPOLY_C
1196 *
1197 * Enable the ChaCha20-Poly1305 AEAD algorithm.
1198 *
1199 * Module: library/chachapoly.c
1200 *
1201 * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
1202 */
1203#define MBEDTLS_CHACHAPOLY_C
1204
1205/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001206 * \def MBEDTLS_CIPHER_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001207 *
1208 * Enable the generic cipher layer.
1209 *
Paul Bakker8123e9d2011-01-06 15:37:30 +00001210 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +02001211 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +00001212 *
1213 * Uncomment to enable generic cipher wrappers.
1214 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001215#define MBEDTLS_CIPHER_C
Paul Bakker8123e9d2011-01-06 15:37:30 +00001216
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001217/**
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001218 * \def MBEDTLS_CMAC_C
1219 *
Simon Butcher327398a2016-10-05 14:09:11 +01001220 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
1221 * ciphers.
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001222 *
1223 * Module: library/cmac.c
1224 *
Simon Butcher69283e52016-10-06 12:49:58 +01001225 * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001226 *
1227 */
Gilles Peskinee59236f2018-01-27 23:32:46 +01001228#define MBEDTLS_CMAC_C
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001229
1230/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001231 * \def MBEDTLS_CTR_DRBG_C
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001232 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001233 * Enable the CTR_DRBG AES-256-based random generator.
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001234 *
1235 * Module: library/ctr_drbg.c
1236 * Caller:
1237 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001238 * Requires: MBEDTLS_AES_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001239 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001240 * This module provides the CTR_DRBG AES-256 random number generator.
1241 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001242#define MBEDTLS_CTR_DRBG_C
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001243
1244/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001245 * \def MBEDTLS_DES_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001246 *
1247 * Enable the DES block cipher.
1248 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001249 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001250 * Caller: library/pem.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +01001251 * library/cipher.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001252 *
Paul Bakker645ce3a2012-10-31 12:32:41 +00001253 * This module enables the following ciphersuites (if other requisites are
1254 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001255 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
1256 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
1257 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
1258 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
1259 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
1260 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
1261 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
1262 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
1263 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
1264 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +01001265 *
Paul Bakkercff68422013-09-15 20:43:33 +02001266 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001267 *
1268 * \warning DES is considered a weak cipher and its use constitutes a
1269 * security risk. We recommend considering stronger ciphers instead.
Paul Bakker5121ce52009-01-03 21:22:43 +00001270 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001271#define MBEDTLS_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001272
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001273/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001274 * \def MBEDTLS_DHM_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001275 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001276 * Enable the Diffie-Hellman-Merkle module.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001277 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001278 * Module: library/dhm.c
1279 * Caller: library/ssl_cli.c
1280 * library/ssl_srv.c
1281 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001282 * This module is used by the following key exchanges:
1283 * DHE-RSA, DHE-PSK
Hanno Beckera2f6b722017-09-28 10:33:29 +01001284 *
Hanno Beckerf9734b32017-10-03 12:09:22 +01001285 * \warning Using DHE constitutes a security risk as it
1286 * is not possible to validate custom DH parameters.
1287 * If possible, it is recommended users should consider
1288 * preferring other methods of key exchange.
1289 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +01001290 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001291 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001292#define MBEDTLS_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001293
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001294/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001295 * \def MBEDTLS_ECDH_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001296 *
1297 * Enable the elliptic curve Diffie-Hellman library.
1298 *
1299 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +01001300 * Caller: library/ssl_cli.c
1301 * library/ssl_srv.c
1302 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001303 * This module is used by the following key exchanges:
1304 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001305 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001306 * Requires: MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001307 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001308#define MBEDTLS_ECDH_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001309
1310/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001311 * \def MBEDTLS_ECDSA_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001312 *
1313 * Enable the elliptic curve DSA library.
1314 *
1315 * Module: library/ecdsa.c
1316 * Caller:
1317 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001318 * This module is used by the following key exchanges:
1319 * ECDHE-ECDSA
1320 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001321 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001322 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001323#define MBEDTLS_ECDSA_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001324
1325/**
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001326 * \def MBEDTLS_ECJPAKE_C
1327 *
1328 * Enable the elliptic curve J-PAKE library.
1329 *
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +02001330 * \warning This is currently experimental. EC J-PAKE support is based on the
1331 * Thread v1.0.0 specification; incompatible changes to the specification
1332 * might still happen. For this reason, this is disabled by default.
1333 *
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001334 * Module: library/ecjpake.c
1335 * Caller:
1336 *
1337 * This module is used by the following key exchanges:
1338 * ECJPAKE
1339 *
1340 * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
1341 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001342#define MBEDTLS_ECJPAKE_C
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001343
1344/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001345 * \def MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001346 *
1347 * Enable the elliptic curve over GF(p) library.
1348 *
1349 * Module: library/ecp.c
1350 * Caller: library/ecdh.c
1351 * library/ecdsa.c
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001352 * library/ecjpake.c
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001353 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001354 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001355 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001356#define MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001357
1358/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001359 * \def MBEDTLS_ENTROPY_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001360 *
1361 * Enable the platform-specific entropy code.
1362 *
1363 * Module: library/entropy.c
1364 * Caller:
1365 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001366 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001367 *
1368 * This module provides a generic entropy pool
1369 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001370#define MBEDTLS_ENTROPY_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001371
1372/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001373 * \def MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +00001374 *
1375 * Enable error code to error string conversion.
1376 *
1377 * Module: library/error.c
1378 * Caller:
1379 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001380 * This module enables mbedtls_strerror().
Paul Bakker9d781402011-05-09 16:17:09 +00001381 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001382#define MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +00001383
1384/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001385 * \def MBEDTLS_GCM_C
Paul Bakker89e80c92012-03-20 13:50:09 +00001386 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001387 * Enable the Galois/Counter Mode (GCM) for AES.
Paul Bakker89e80c92012-03-20 13:50:09 +00001388 *
1389 * Module: library/gcm.c
1390 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001391 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
Paul Bakker645ce3a2012-10-31 12:32:41 +00001392 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001393 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
1394 * requisites are enabled as well.
Paul Bakker89e80c92012-03-20 13:50:09 +00001395 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001396#define MBEDTLS_GCM_C
Paul Bakker89e80c92012-03-20 13:50:09 +00001397
1398/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001399 * \def MBEDTLS_HAVEGE_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001400 *
1401 * Enable the HAVEGE random generator.
1402 *
Paul Bakker2a844242013-06-24 13:01:53 +02001403 * Warning: the HAVEGE random generator is not suitable for virtualized
1404 * environments
1405 *
1406 * Warning: the HAVEGE random generator is dependent on timing and specific
1407 * processor traits. It is therefore not advised to use HAVEGE as
1408 * your applications primary random generator or primary entropy pool
1409 * input. As a secondary input to your entropy pool, it IS able add
1410 * the (limited) extra entropy it provides.
1411 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001412 * Module: library/havege.c
1413 * Caller:
1414 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001415 * Requires: MBEDTLS_TIMING_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001416 *
Paul Bakker2a844242013-06-24 13:01:53 +02001417 * Uncomment to enable the HAVEGE random generator.
Paul Bakker2a844242013-06-24 13:01:53 +02001418 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001419//#define MBEDTLS_HAVEGE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001420
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001421/**
Thomas Fossati656864b2016-07-17 08:51:22 +01001422 * \def MBEDTLS_HKDF_C
1423 *
1424 * Enable the HKDF algorithm (RFC 5869).
1425 *
1426 * Module: library/hkdf.c
1427 * Caller:
1428 *
1429 * Requires: MBEDTLS_MD_C
1430 *
1431 * This module adds support for the Hashed Message Authentication Code
1432 * (HMAC)-based key derivation function (HKDF).
1433 */
1434#define MBEDTLS_HKDF_C
1435
1436/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001437 * \def MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01001438 *
1439 * Enable the HMAC_DRBG random generator.
1440 *
1441 * Module: library/hmac_drbg.c
1442 * Caller:
1443 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001444 * Requires: MBEDTLS_MD_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01001445 *
1446 * Uncomment to enable the HMAC_DRBG random number geerator.
1447 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001448#define MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01001449
1450/**
Ron Eldor466a57f2018-05-03 16:54:28 +03001451 * \def MBEDTLS_NIST_KW_C
1452 *
1453 * Enable the Key Wrapping mode for 128-bit block ciphers,
1454 * as defined in NIST SP 800-38F. Only KW and KWP modes
1455 * are supported. At the moment, only AES is approved by NIST.
1456 *
1457 * Module: library/nist_kw.c
1458 *
1459 * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C
1460 */
1461//#define MBEDTLS_NIST_KW_C
1462
1463/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001464 * \def MBEDTLS_MD_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001465 *
1466 * Enable the generic message digest layer.
1467 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001468 * Module: library/md.c
Paul Bakker17373852011-01-06 14:20:01 +00001469 * Caller:
1470 *
1471 * Uncomment to enable generic message digest wrappers.
1472 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001473#define MBEDTLS_MD_C
Paul Bakker17373852011-01-06 14:20:01 +00001474
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001475/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001476 * \def MBEDTLS_MD2_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001477 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001478 * Enable the MD2 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001479 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001480 * Module: library/md2.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001481 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001482 *
1483 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001484 *
1485 * \warning MD2 is considered a weak message digest and its use constitutes a
1486 * security risk. If possible, we recommend avoiding dependencies on
1487 * it, and considering stronger message digests instead.
1488 *
Paul Bakker6506aff2009-07-28 20:52:02 +00001489 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001490#define MBEDTLS_MD2_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001491
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001492/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001493 * \def MBEDTLS_MD4_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001494 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001495 * Enable the MD4 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001496 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001497 * Module: library/md4.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001498 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001499 *
1500 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001501 *
1502 * \warning MD4 is considered a weak message digest and its use constitutes a
1503 * security risk. If possible, we recommend avoiding dependencies on
1504 * it, and considering stronger message digests instead.
1505 *
Paul Bakker6506aff2009-07-28 20:52:02 +00001506 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001507#define MBEDTLS_MD4_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001508
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001509/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001510 * \def MBEDTLS_MD5_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001511 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001512 * Enable the MD5 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001513 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001514 * Module: library/md5.c
1515 * Caller: library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001516 * library/pem.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001517 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001518 *
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001519 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
1520 * depending on the handshake parameters. Further, it is used for checking
1521 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
1522 * encrypted keys.
1523 *
1524 * \warning MD5 is considered a weak message digest and its use constitutes a
1525 * security risk. If possible, we recommend avoiding dependencies on
1526 * it, and considering stronger message digests instead.
1527 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001528 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001529#define MBEDTLS_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001530
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001531/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001532 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001533 *
1534 * Enable the buffer allocator implementation that makes use of a (stack)
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02001535 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001536 * calls)
Paul Bakker6e339b52013-07-03 13:37:05 +02001537 *
1538 * Module: library/memory_buffer_alloc.c
1539 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001540 * Requires: MBEDTLS_PLATFORM_C
1541 * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
Paul Bakker6e339b52013-07-03 13:37:05 +02001542 *
1543 * Enable this module to enable the buffer memory allocator.
Paul Bakker6e339b52013-07-03 13:37:05 +02001544 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001545//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +02001546
1547/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001548 * \def MBEDTLS_OID_C
Paul Bakkerc70b9822013-04-07 22:00:46 +02001549 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001550 * Enable the OID database.
Paul Bakkerc70b9822013-04-07 22:00:46 +02001551 *
1552 * Module: library/oid.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001553 * Caller: library/asn1write.c
1554 * library/pkcs5.c
1555 * library/pkparse.c
1556 * library/pkwrite.c
1557 * library/rsa.c
1558 * library/x509.c
1559 * library/x509_create.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001560 * library/x509_crl.c
1561 * library/x509_crt.c
1562 * library/x509_csr.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001563 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001564 * library/x509write_csr.c
Paul Bakkerc70b9822013-04-07 22:00:46 +02001565 *
1566 * This modules translates between OIDs and internal values.
1567 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001568#define MBEDTLS_OID_C
Paul Bakkerc70b9822013-04-07 22:00:46 +02001569
1570/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001571 * \def MBEDTLS_PADLOCK_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001572 *
1573 * Enable VIA Padlock support on x86.
1574 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001575 * Module: library/padlock.c
1576 * Caller: library/aes.c
1577 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001578 * Requires: MBEDTLS_HAVE_ASM
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01001579 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001580 * This modules adds support for the VIA PadLock on x86.
1581 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001582//#define MBEDTLS_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001583
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001584/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001585 * \def MBEDTLS_PEM_PARSE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001586 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001587 * Enable PEM decoding / parsing.
Paul Bakker96743fc2011-02-12 14:30:57 +00001588 *
1589 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001590 * Caller: library/dhm.c
Paul Bakkercff68422013-09-15 20:43:33 +02001591 * library/pkparse.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001592 * library/x509_crl.c
1593 * library/x509_crt.c
1594 * library/x509_csr.c
Paul Bakker96743fc2011-02-12 14:30:57 +00001595 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001596 * Requires: MBEDTLS_BASE64_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001597 *
Paul Bakkercff68422013-09-15 20:43:33 +02001598 * This modules adds support for decoding / parsing PEM files.
Paul Bakker96743fc2011-02-12 14:30:57 +00001599 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001600#define MBEDTLS_PEM_PARSE_C
Paul Bakkercff68422013-09-15 20:43:33 +02001601
1602/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001603 * \def MBEDTLS_PEM_WRITE_C
Paul Bakkercff68422013-09-15 20:43:33 +02001604 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001605 * Enable PEM encoding / writing.
Paul Bakkercff68422013-09-15 20:43:33 +02001606 *
1607 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001608 * Caller: library/pkwrite.c
1609 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001610 * library/x509write_csr.c
Paul Bakkercff68422013-09-15 20:43:33 +02001611 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001612 * Requires: MBEDTLS_BASE64_C
Paul Bakkercff68422013-09-15 20:43:33 +02001613 *
1614 * This modules adds support for encoding / writing PEM files.
1615 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001616#define MBEDTLS_PEM_WRITE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001617
1618/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001619 * \def MBEDTLS_PK_C
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001620 *
1621 * Enable the generic public (asymetric) key layer.
1622 *
1623 * Module: library/pk.c
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001624 * Caller: library/ssl_tls.c
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001625 * library/ssl_cli.c
1626 * library/ssl_srv.c
1627 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001628 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001629 *
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001630 * Uncomment to enable generic public key wrappers.
1631 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001632#define MBEDTLS_PK_C
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001633
1634/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001635 * \def MBEDTLS_PK_PARSE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001636 *
1637 * Enable the generic public (asymetric) key parser.
1638 *
1639 * Module: library/pkparse.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001640 * Caller: library/x509_crt.c
1641 * library/x509_csr.c
Paul Bakker4606c732013-09-15 17:04:23 +02001642 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001643 * Requires: MBEDTLS_PK_C
Paul Bakker4606c732013-09-15 17:04:23 +02001644 *
1645 * Uncomment to enable generic public key parse functions.
1646 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001647#define MBEDTLS_PK_PARSE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001648
1649/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001650 * \def MBEDTLS_PK_WRITE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001651 *
Paul Bakkerf20ba4b2013-09-16 22:46:20 +02001652 * Enable the generic public (asymetric) key writer.
Paul Bakker4606c732013-09-15 17:04:23 +02001653 *
1654 * Module: library/pkwrite.c
1655 * Caller: library/x509write.c
1656 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001657 * Requires: MBEDTLS_PK_C
Paul Bakker4606c732013-09-15 17:04:23 +02001658 *
1659 * Uncomment to enable generic public key write functions.
1660 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001661#define MBEDTLS_PK_WRITE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001662
1663/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001664 * \def MBEDTLS_PKCS5_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001665 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001666 * Enable PKCS#5 functions.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001667 *
1668 * Module: library/pkcs5.c
1669 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001670 * Requires: MBEDTLS_MD_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001671 *
1672 * This module adds support for the PKCS#5 functions.
1673 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001674#define MBEDTLS_PKCS5_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001675
1676/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001677 * \def MBEDTLS_PKCS11_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001678 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001679 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001680 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001681 * Module: library/pkcs11.c
1682 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001683 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001684 * Requires: MBEDTLS_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001685 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001686 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001687 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
Paul Bakker5690efc2011-05-26 13:16:06 +00001688 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001689//#define MBEDTLS_PKCS11_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001690
1691/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001692 * \def MBEDTLS_PKCS12_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001693 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001694 * Enable PKCS#12 PBE functions.
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001695 * Adds algorithms for parsing PKCS#8 encrypted private keys
1696 *
1697 * Module: library/pkcs12.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001698 * Caller: library/pkparse.c
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001699 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001700 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
1701 * Can use: MBEDTLS_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001702 *
1703 * This module enables PKCS#12 functions.
1704 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001705#define MBEDTLS_PKCS12_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001706
1707/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001708 * \def MBEDTLS_PLATFORM_C
Paul Bakker747a83a2014-02-01 22:50:07 +01001709 *
1710 * Enable the platform abstraction layer that allows you to re-assign
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001711 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
Paul Bakker747a83a2014-02-01 22:50:07 +01001712 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001713 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
1714 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
Rich Evans16f8cd82015-02-06 16:14:34 +00001715 * above to be specified at runtime or compile time respectively.
Paul Bakker747a83a2014-02-01 22:50:07 +01001716 *
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001717 * \note This abstraction layer must be enabled on Windows (including MSYS2)
1718 * as other module rely on it for a fixed snprintf implementation.
1719 *
Paul Bakker747a83a2014-02-01 22:50:07 +01001720 * Module: library/platform.c
1721 * Caller: Most other .c files
1722 *
1723 * This module enables abstraction of common (libc) functions.
1724 */
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02001725#define MBEDTLS_PLATFORM_C
Paul Bakker747a83a2014-02-01 22:50:07 +01001726
1727/**
Daniel Kingadc32c02016-05-16 18:25:45 -03001728 * \def MBEDTLS_POLY1305_C
1729 *
1730 * Enable the Poly1305 MAC algorithm.
1731 *
1732 * Module: library/poly1305.c
Manuel Pégourié-Gonnarddca3a5d2018-05-07 10:43:27 +02001733 * Caller: library/chachapoly.c
Daniel Kingadc32c02016-05-16 18:25:45 -03001734 */
1735#define MBEDTLS_POLY1305_C
1736
1737/**
Gilles Peskinee59236f2018-01-27 23:32:46 +01001738* \def MBEDTLS_PSA_CRYPTO_C
1739 *
1740 * Enable the Platform Security Architecture cryptography API.
1741 *
1742 * Module: library/psa_crypto.c
1743 *
1744 * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C
1745 *
1746 */
1747#define MBEDTLS_PSA_CRYPTO_C
1748
1749/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001750 * \def MBEDTLS_RIPEMD160_C
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01001751 *
1752 * Enable the RIPEMD-160 hash algorithm.
1753 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001754 * Module: library/ripemd160.c
1755 * Caller: library/md.c
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01001756 *
1757 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001758#define MBEDTLS_RIPEMD160_C
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01001759
1760/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001761 * \def MBEDTLS_RSA_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001762 *
1763 * Enable the RSA public-key cryptosystem.
1764 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001765 * Module: library/rsa.c
Hanno Beckera565f542017-10-11 11:00:19 +01001766 * library/rsa_internal.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001767 * Caller: library/ssl_cli.c
1768 * library/ssl_srv.c
1769 * library/ssl_tls.c
1770 * library/x509.c
1771 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001772 * This module is used by the following key exchanges:
1773 * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
Paul Bakker5690efc2011-05-26 13:16:06 +00001774 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001775 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001776 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001777#define MBEDTLS_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001778
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001779/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001780 * \def MBEDTLS_SHA1_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001781 *
1782 * Enable the SHA1 cryptographic hash algorithm.
1783 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001784 * Module: library/sha1.c
1785 * Caller: library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001786 * library/ssl_cli.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001787 * library/ssl_srv.c
1788 * library/ssl_tls.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001789 * library/x509write_crt.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001790 *
Gilles Peskine5e79cb32017-05-04 16:17:21 +02001791 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
1792 * depending on the handshake parameters, and for SHA1-signed certificates.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001793 *
1794 * \warning SHA-1 is considered a weak message digest and its use constitutes
1795 * a security risk. If possible, we recommend avoiding dependencies
1796 * on it, and considering stronger message digests instead.
1797 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001798 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001799#define MBEDTLS_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001800
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001801/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001802 * \def MBEDTLS_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001803 *
1804 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
1805 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001806 * Module: library/sha256.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001807 * Caller: library/entropy.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001808 * library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001809 * library/ssl_cli.c
1810 * library/ssl_srv.c
1811 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001812 *
1813 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001814 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001815 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001816#define MBEDTLS_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001817
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001818/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001819 * \def MBEDTLS_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001820 *
1821 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
1822 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001823 * Module: library/sha512.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001824 * Caller: library/entropy.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001825 * library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001826 * library/ssl_cli.c
1827 * library/ssl_srv.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001828 *
1829 * This module adds support for SHA-384 and SHA-512.
1830 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001831#define MBEDTLS_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001832
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001833/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001834 * \def MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +02001835 *
1836 * Enable the threading abstraction layer.
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +00001837 * By default mbed TLS assumes it is used in a non-threaded environment or that
Paul Bakker2466d932013-09-28 14:40:38 +02001838 * contexts are not shared between threads. If you do intend to use contexts
1839 * between threads, you will need to enable this layer to prevent race
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00001840 * conditions. See also our Knowledge Base article about threading:
1841 * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
Paul Bakker2466d932013-09-28 14:40:38 +02001842 *
1843 * Module: library/threading.c
1844 *
1845 * This allows different threading implementations (self-implemented or
1846 * provided).
1847 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001848 * You will have to enable either MBEDTLS_THREADING_ALT or
1849 * MBEDTLS_THREADING_PTHREAD.
Paul Bakker2466d932013-09-28 14:40:38 +02001850 *
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +00001851 * Enable this layer to allow use of mutexes within mbed TLS
Paul Bakker2466d932013-09-28 14:40:38 +02001852 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001853//#define MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +02001854
1855/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001856 * \def MBEDTLS_VERSION_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001857 *
1858 * Enable run-time version information.
1859 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001860 * Module: library/version.c
1861 *
1862 * This module provides run-time version information.
1863 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001864#define MBEDTLS_VERSION_C
Paul Bakker0a62cd12011-01-21 11:00:08 +00001865
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001866/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001867 * \def MBEDTLS_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001868 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001869 * Enable the XTEA block cipher.
1870 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001871 * Module: library/xtea.c
1872 * Caller:
1873 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001874#define MBEDTLS_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001875
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +00001876/* \} name SECTION: mbed TLS modules */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001877
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001878/**
1879 * \name SECTION: Module configuration options
1880 *
1881 * This section allows for the setting of module specific sizes and
1882 * configuration options. The default values are already present in the
1883 * relevant header files and should suffice for the regular use cases.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001884 *
Paul Bakker088c5c52014-04-25 11:11:10 +02001885 * Our advice is to enable options and change their values here
1886 * only if you have a good reason and know the consequences.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001887 *
1888 * Please check the respective header file for documentation on these
1889 * parameters (to prevent duplicate documentation).
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001890 * \{
1891 */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001892
Paul Bakker088c5c52014-04-25 11:11:10 +02001893/* MPI / BIGNUM options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001894//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1895//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001896
Paul Bakker088c5c52014-04-25 11:11:10 +02001897/* CTR_DRBG options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001898//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
1899//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1900//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1901//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1902//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001903
Paul Bakker088c5c52014-04-25 11:11:10 +02001904/* HMAC_DRBG options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001905//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1906//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1907//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1908//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001909
Paul Bakker088c5c52014-04-25 11:11:10 +02001910/* ECP options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001911//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
1912//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
1913//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
Manuel Pégourié-Gonnard0520b602014-01-30 19:43:46 +01001914
Paul Bakker088c5c52014-04-25 11:11:10 +02001915/* Entropy options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001916//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1917//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
Andres AG7abc9742016-09-23 17:58:49 +01001918//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
Paul Bakkere1b665e2013-12-11 16:02:58 +01001919
Paul Bakker088c5c52014-04-25 11:11:10 +02001920/* Memory buffer allocator options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001921//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001922
Paul Bakker088c5c52014-04-25 11:11:10 +02001923/* Platform options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001924//#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. */
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02001925//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001926//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
1927//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
Andres Amaya Garcia1e4ec662016-07-20 10:16:25 +01001928//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001929//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
1930//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001931/* Note: your snprintf must correclty zero-terminate the buffer! */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001932//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
Janos Follath91947442016-03-18 13:49:27 +00001933//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
1934//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
Paul Bakkercf0a9f92016-06-01 11:25:44 +01001935//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1936//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
1937//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
Paul Bakker6e339b52013-07-03 13:37:05 +02001938
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001939/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
1940/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02001941//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001942//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
1943//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
Andres Amaya Garcia1e4ec662016-07-20 10:16:25 +01001944//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1945//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001946//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
1947//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001948/* Note: your snprintf must correclty zero-terminate the buffer! */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001949//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
Paul Bakkercf0a9f92016-06-01 11:25:44 +01001950//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1951//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001952
Paul Bakker088c5c52014-04-25 11:11:10 +02001953/* SSL Cache options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001954//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1955//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001956
Paul Bakker088c5c52014-04-25 11:11:10 +02001957/* SSL options */
Angus Grattond8213d02016-05-25 20:56:48 +10001958
1959/** \def MBEDTLS_SSL_MAX_CONTENT_LEN
1960 *
1961 * Maximum fragment length in bytes.
1962 *
1963 * Determines the size of both the incoming and outgoing TLS I/O buffers.
1964 *
1965 * Uncommenting MBEDTLS_SSL_IN_CONTENT_LEN and/or MBEDTLS_SSL_OUT_CONTENT_LEN
1966 * will override this length by setting maximum incoming and/or outgoing
1967 * fragment length, respectively.
1968 */
1969//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384
1970
1971/** \def MBEDTLS_SSL_IN_CONTENT_LEN
1972 *
1973 * Maximum incoming fragment length in bytes.
1974 *
1975 * Uncomment to set the size of the inward TLS buffer independently of the
1976 * outward buffer.
1977 */
1978//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
1979
1980/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
1981 *
1982 * Maximum outgoing fragment length in bytes.
1983 *
1984 * Uncomment to set the size of the outward TLS buffer independently of the
1985 * inward buffer.
1986 *
1987 * It is possible to save RAM by setting a smaller outward buffer, while keeping
1988 * the default inward 16384 byte buffer to conform to the TLS specification.
1989 *
1990 * The minimum required outward buffer size is determined by the handshake
1991 * protocol's usage. Handshaking will fail if the outward buffer is too small.
1992 * The specific size requirement depends on the configured ciphers and any
1993 * certificate data which is sent during the handshake.
1994 *
1995 * For absolute minimum RAM usage, it's best to enable
1996 * MBEDTLS_SSL_MAX_FRAGMENT_LENGTH and reduce MBEDTLS_SSL_MAX_CONTENT_LEN. This
1997 * reduces both incoming and outgoing buffer sizes. However this is only
1998 * guaranteed if the other end of the connection also supports the TLS
1999 * max_fragment_len extension. Otherwise the connection may fail.
2000 */
2001//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
2002
Hanno Beckere0b150f2018-08-21 15:51:03 +01002003/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
2004 *
2005 * Maximum number of heap-allocated bytes for the purpose of
2006 * DTLS handshake message reassembly and future message buffering.
2007 *
Hanno Becker97a1c132018-08-28 14:42:15 +01002008 * This should be at least 9/8 * MBEDTLSSL_IN_CONTENT_LEN
Hanno Becker28007512018-08-28 09:46:44 +01002009 * to account for a reassembled handshake message of maximum size,
2010 * together with its reassembly bitmap.
2011 *
Hanno Becker97a1c132018-08-28 14:42:15 +01002012 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
Hanno Becker28007512018-08-28 09:46:44 +01002013 * should be sufficient for all practical situations as it allows
2014 * to reassembly a large handshake message (such as a certificate)
2015 * while buffering multiple smaller handshake messages.
2016 *
Hanno Beckere0b150f2018-08-21 15:51:03 +01002017 */
Hanno Becker159a37f2018-08-24 15:07:29 +01002018//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
Hanno Beckere0b150f2018-08-21 15:51:03 +01002019
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002020//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
2021//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
2022//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02002023
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02002024/**
2025 * Complete list of ciphersuites to use, in order of preference.
2026 *
2027 * \warning No dependency checking is done on that field! This option can only
2028 * be used to restrict the set of available ciphersuites. It is your
2029 * responsibility to make sure the needed modules are active.
2030 *
2031 * Use this to save a few hundred bytes of ROM (default ordering of all
2032 * available ciphersuites) and a few to a few hundred bytes of RAM.
2033 *
2034 * The value below is only an example, not the default.
2035 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002036//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02002037
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01002038/* X509 options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002039//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
Andres AGf9113192016-09-02 14:06:04 +01002040//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01002041
Gilles Peskine5e79cb32017-05-04 16:17:21 +02002042/**
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002043 * Allow SHA-1 in the default TLS configuration for certificate signing.
2044 * Without this build-time option, SHA-1 support must be activated explicitly
2045 * through mbedtls_ssl_conf_cert_profile. Turning on this option is not
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002046 * recommended because of it is possible to generate SHA-1 collisions, however
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002047 * this may be safe for legacy infrastructure where additional controls apply.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002048 *
2049 * \warning SHA-1 is considered a weak message digest and its use constitutes
2050 * a security risk. If possible, we recommend avoiding dependencies
2051 * on it, and considering stronger message digests instead.
2052 *
Gilles Peskine5e79cb32017-05-04 16:17:21 +02002053 */
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002054// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
2055
2056/**
2057 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
2058 * signature and ciphersuite selection. Without this build-time option, SHA-1
2059 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
2060 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
2061 * default. At the time of writing, there is no practical attack on the use
2062 * of SHA-1 in handshake signatures, hence this option is turned on by default
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002063 * to preserve compatibility with existing peers, but the general
2064 * warning applies nonetheless:
2065 *
2066 * \warning SHA-1 is considered a weak message digest and its use constitutes
2067 * a security risk. If possible, we recommend avoiding dependencies
2068 * on it, and considering stronger message digests instead.
2069 *
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002070 */
2071#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
Gilles Peskine5e79cb32017-05-04 16:17:21 +02002072
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002073/**
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002074 * Uncomment the macro to let mbed TLS use your alternate implementation of
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002075 * mbedtls_platform_zeroize(). This replaces the default implementation in
2076 * platform_util.c.
Andres Amaya Garcia6606d5c2018-03-08 20:25:29 +00002077 *
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002078 * mbedtls_platform_zeroize() is a widely used function across the library to
2079 * zero a block of memory. The implementation is expected to be secure in the
2080 * sense that it has been written to prevent the compiler from removing calls
2081 * to mbedtls_platform_zeroize() as part of redundant code elimination
2082 * optimizations. However, it is difficult to guarantee that calls to
2083 * mbedtls_platform_zeroize() will not be optimized by the compiler as older
2084 * versions of the C language standards do not provide a secure implementation
2085 * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to
2086 * configure their own implementation of mbedtls_platform_zeroize(), for
Andres Amaya Garciad0ef4682018-04-24 08:31:34 -05002087 * example by using directives specific to their compiler, features from newer
2088 * C standards (e.g using memset_s() in C11) or calling a secure memset() from
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002089 * their system (e.g explicit_bzero() in BSD).
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002090 */
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002091//#define MBEDTLS_PLATFORM_ZEROIZE_ALT
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002092
Simon Butcher30b5f972016-06-08 19:00:23 +01002093/* \} name SECTION: Customisation configuration options */
Manuel Pégourié-Gonnard43569a92015-07-31 15:37:29 +02002094
Simon Butcherb2c81b12016-06-23 13:56:06 +01002095/* Target and application specific configurations */
Ron Eldor6fd941f2017-05-14 16:17:33 +03002096//#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "target_config.h"
Simon Butcher1d46a2d2016-07-11 10:17:03 +01002097
2098#if defined(TARGET_LIKE_MBED) && defined(YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE)
2099#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
2100#endif
Simon Butcherb2c81b12016-06-23 13:56:06 +01002101
Manuel Pégourié-Gonnard32da9f62015-07-31 15:52:30 +02002102/*
2103 * Allow user to override any previous default.
2104 *
2105 * Use two macro names for that, as:
2106 * - with yotta the prefix YOTTA_CFG_ is forced
2107 * - without yotta is looks weird to have a YOTTA prefix.
2108 */
2109#if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
2110#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
2111#elif defined(MBEDTLS_USER_CONFIG_FILE)
2112#include MBEDTLS_USER_CONFIG_FILE
2113#endif
2114
Gilles Peskine66920ce2018-03-03 21:49:49 +01002115#include "mbedtls/check_config.h"
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01002116
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002117#endif /* MBEDTLS_CONFIG_H */