blob: 2ae69911cdd151f011782567bba9e3c20f91337f [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 *
Paul Bakker747a83a2014-02-01 22:50:07 +0100181 * Uncomment a macro to enable alternate implementation of specific base
182 * platform function
183 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200184//#define MBEDTLS_PLATFORM_EXIT_ALT
185//#define MBEDTLS_PLATFORM_FPRINTF_ALT
186//#define MBEDTLS_PLATFORM_PRINTF_ALT
187//#define MBEDTLS_PLATFORM_SNPRINTF_ALT
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100188//#define MBEDTLS_PLATFORM_NV_SEED_ALT
Andres Amaya Garciad91f99f2017-07-18 10:23:04 +0100189//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100190
191/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200192 * \def MBEDTLS_DEPRECATED_WARNING
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100193 *
194 * Mark deprecated functions so that they generate a warning if used.
195 * Functions deprecated in one version will usually be removed in the next
196 * version. You can enable this to help you prepare the transition to a new
197 * major version by making sure your code is not using these functions.
198 *
199 * This only works with GCC and Clang. With other compilers, you may want to
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200200 * use MBEDTLS_DEPRECATED_REMOVED
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100201 *
202 * Uncomment to get warnings on using deprecated functions.
203 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200204//#define MBEDTLS_DEPRECATED_WARNING
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100205
206/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200207 * \def MBEDTLS_DEPRECATED_REMOVED
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100208 *
209 * Remove deprecated functions so that they generate an error if used.
210 * Functions deprecated in one version will usually be removed in the next
211 * version. You can enable this to help you prepare the transition to a new
212 * major version by making sure your code is not using these functions.
213 *
214 * Uncomment to get errors on using deprecated functions.
215 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200216//#define MBEDTLS_DEPRECATED_REMOVED
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +0100217
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200218/* \} name SECTION: System support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000219
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000220/**
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000221 * \name SECTION: mbed TLS feature support
Paul Bakker0a62cd12011-01-21 11:00:08 +0000222 *
223 * This section sets support for features that are or are not needed
224 * within the modules that are enabled.
225 * \{
226 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000227
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000228/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100229 * \def MBEDTLS_AES_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200230 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100231 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
Janos Follathb0697532016-08-18 12:38:46 +0100232 * alternate core implementation of a symmetric crypto, an arithmetic or hash
233 * module (e.g. platform specific assembly optimized implementations). Keep
234 * in mind that the function prototypes should remain the same.
Paul Bakker90995b52013-06-24 19:20:35 +0200235 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200236 * This replaces the whole module. If you only want to replace one of the
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200237 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200238 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200239 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
Janos Follathee782bc2016-11-07 15:41:26 +0000240 * provide the "struct mbedtls_aes_context" definition and omit the base
241 * function declarations and implementations. "aes_alt.h" will be included from
Paul Bakker90995b52013-06-24 19:20:35 +0200242 * "aes.h" to include the new function definitions.
243 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200244 * Uncomment a macro to enable alternate implementation of the corresponding
245 * module.
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100246 *
247 * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
248 * use constitutes a security risk. If possible, we recommend
249 * avoiding dependencies on them, and considering stronger message
250 * digests and ciphers instead.
251 *
Paul Bakker90995b52013-06-24 19:20:35 +0200252 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200253//#define MBEDTLS_AES_ALT
254//#define MBEDTLS_ARC4_ALT
Markku-Juhani O. Saarinen0fb47fe2017-12-01 15:41:38 +0000255//#define MBEDTLS_ARIA_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200256//#define MBEDTLS_BLOWFISH_ALT
257//#define MBEDTLS_CAMELLIA_ALT
Steven Cooreman222e2ff2017-04-04 11:37:15 +0200258//#define MBEDTLS_CCM_ALT
Daniel King34b822c2016-05-15 17:28:08 -0300259//#define MBEDTLS_CHACHA20_ALT
Manuel Pégourié-Gonnarde533b222018-06-04 12:23:19 +0200260//#define MBEDTLS_CHACHAPOLY_ALT
Steven Cooreman63342772017-04-04 11:47:16 +0200261//#define MBEDTLS_CMAC_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200262//#define MBEDTLS_DES_ALT
nirekh01d569ecf2018-01-09 16:43:21 +0000263//#define MBEDTLS_DHM_ALT
Hanno Becker616d1ca2018-01-24 10:25:05 +0000264//#define MBEDTLS_ECJPAKE_ALT
Jaeden Amero15263302017-09-21 12:53:48 +0100265//#define MBEDTLS_GCM_ALT
Ron Eldor466a57f2018-05-03 16:54:28 +0300266//#define MBEDTLS_NIST_KW_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200267//#define MBEDTLS_MD2_ALT
268//#define MBEDTLS_MD4_ALT
269//#define MBEDTLS_MD5_ALT
Daniel Kingadc32c02016-05-16 18:25:45 -0300270//#define MBEDTLS_POLY1305_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200271//#define MBEDTLS_RIPEMD160_ALT
Hanno Becker88683b22018-01-04 18:26:54 +0000272//#define MBEDTLS_RSA_ALT
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200273//#define MBEDTLS_SHA1_ALT
274//#define MBEDTLS_SHA256_ALT
275//#define MBEDTLS_SHA512_ALT
Hanno Becker88683b22018-01-04 18:26:54 +0000276//#define MBEDTLS_XTEA_ALT
Markku-Juhani O. Saarinen0fb47fe2017-12-01 15:41:38 +0000277
Janos Follathb0697532016-08-18 12:38:46 +0100278/*
279 * When replacing the elliptic curve module, pleace consider, that it is
280 * implemented with two .c files:
281 * - ecp.c
282 * - ecp_curves.c
Janos Follathee782bc2016-11-07 15:41:26 +0000283 * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT
284 * macros as described above. The only difference is that you have to make sure
285 * that you provide functionality for both .c files.
Janos Follathb0697532016-08-18 12:38:46 +0100286 */
287//#define MBEDTLS_ECP_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200288
289/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100290 * \def MBEDTLS_MD2_PROCESS_ALT
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200291 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100292 * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you
293 * alternate core implementation of symmetric crypto or hash function. Keep in
294 * mind that function prototypes should remain the same.
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200295 *
296 * This replaces only one function. The header file from mbed TLS is still
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200297 * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags.
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200298 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200299 * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will
300 * no longer provide the mbedtls_sha1_process() function, but it will still provide
301 * the other function (using your mbedtls_sha1_process() function) and the definition
302 * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200303 * with this definition.
304 *
Hanno Becker6d84ae72017-06-26 12:46:19 +0100305 * \note Because of a signature change, the core AES encryption and decryption routines are
306 * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt,
307 * respectively. When setting up alternative implementations, these functions should
308 * be overriden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt
Hanno Beckerca1cdb22017-07-20 09:50:59 +0100309 * must stay untouched.
Hanno Becker6d84ae72017-06-26 12:46:19 +0100310 *
311 * \note If you use the AES_xxx_ALT macros, then is is recommended to also set
312 * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
313 * tables.
Manuel Pégourié-Gonnard31993f22015-05-12 15:41:08 +0200314 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200315 * Uncomment a macro to enable alternate implementation of the corresponding
316 * function.
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100317 *
318 * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use
319 * constitutes a security risk. If possible, we recommend avoiding
320 * dependencies on them, and considering stronger message digests
321 * and ciphers instead.
322 *
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200323 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200324//#define MBEDTLS_MD2_PROCESS_ALT
325//#define MBEDTLS_MD4_PROCESS_ALT
326//#define MBEDTLS_MD5_PROCESS_ALT
327//#define MBEDTLS_RIPEMD160_PROCESS_ALT
328//#define MBEDTLS_SHA1_PROCESS_ALT
329//#define MBEDTLS_SHA256_PROCESS_ALT
330//#define MBEDTLS_SHA512_PROCESS_ALT
Manuel Pégourié-Gonnard70a50102015-05-12 15:02:45 +0200331//#define MBEDTLS_DES_SETKEY_ALT
332//#define MBEDTLS_DES_CRYPT_ECB_ALT
333//#define MBEDTLS_DES3_CRYPT_ECB_ALT
Manuel Pégourié-Gonnard31993f22015-05-12 15:41:08 +0200334//#define MBEDTLS_AES_SETKEY_ENC_ALT
335//#define MBEDTLS_AES_SETKEY_DEC_ALT
336//#define MBEDTLS_AES_ENCRYPT_ALT
337//#define MBEDTLS_AES_DECRYPT_ALT
Ron Eldora84c1cb2017-10-10 19:04:27 +0300338//#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
Ron Eldor3226d362017-10-12 14:17:48 +0300339//#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT
Ron Eldor314adb62017-10-10 18:28:25 +0300340//#define MBEDTLS_ECDSA_VERIFY_ALT
341//#define MBEDTLS_ECDSA_SIGN_ALT
342//#define MBEDTLS_ECDSA_GENKEY_ALT
Manuel Pégourié-Gonnard427b6722015-03-31 18:32:50 +0200343
344/**
Janos Follathc44ab972016-11-18 16:38:23 +0000345 * \def MBEDTLS_ECP_INTERNAL_ALT
346 *
347 * Expose a part of the internal interface of the Elliptic Curve Point module.
Janos Follathb0697532016-08-18 12:38:46 +0100348 *
349 * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your
Janos Follath372697b2016-10-28 16:53:11 +0100350 * alternative core implementation of elliptic curve arithmetic. Keep in mind
351 * that function prototypes should remain the same.
Janos Follathb0697532016-08-18 12:38:46 +0100352 *
353 * This partially replaces one function. The header file from mbed TLS is still
354 * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation
355 * is still present and it is used for group structures not supported by the
356 * alternative.
357 *
Janos Follathc44ab972016-11-18 16:38:23 +0000358 * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT
359 * and implementing the following functions:
360 * unsigned char mbedtls_internal_ecp_grp_capable(
361 * const mbedtls_ecp_group *grp )
362 * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp )
363 * void mbedtls_internal_ecp_deinit( const mbedtls_ecp_group *grp )
364 * The mbedtls_internal_ecp_grp_capable function should return 1 if the
365 * replacement functions implement arithmetic for the given group and 0
366 * otherwise.
367 * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_deinit are
368 * called before and after each point operation and provide an opportunity to
369 * implement optimized set up and tear down instructions.
Janos Follathb0697532016-08-18 12:38:46 +0100370 *
Janos Follathc44ab972016-11-18 16:38:23 +0000371 * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and
Janos Follath4d9c69d2016-11-01 13:27:03 +0000372 * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac
Janos Follathc44ab972016-11-18 16:38:23 +0000373 * function, but will use your mbedtls_internal_ecp_double_jac if the group is
374 * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when
375 * receives it as an argument). If the group is not supported then the original
Janos Follathee782bc2016-11-07 15:41:26 +0000376 * implementation is used. The other functions and the definition of
377 * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your
Janos Follathc44ab972016-11-18 16:38:23 +0000378 * implementation of mbedtls_internal_ecp_double_jac and
379 * mbedtls_internal_ecp_grp_capable must be compatible with this definition.
Janos Follathb0697532016-08-18 12:38:46 +0100380 *
381 * Uncomment a macro to enable alternate implementation of the corresponding
382 * function.
383 */
384/* Required for all the functions in this section */
Janos Follathc44ab972016-11-18 16:38:23 +0000385//#define MBEDTLS_ECP_INTERNAL_ALT
Janos Follathb0697532016-08-18 12:38:46 +0100386/* Support for Weierstrass curves with Jacobi representation */
387//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
388//#define MBEDTLS_ECP_ADD_MIXED_ALT
389//#define MBEDTLS_ECP_DOUBLE_JAC_ALT
390//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
391//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
392/* Support for curves with Montgomery arithmetic */
393//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
394//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
395//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
396
397/**
Simon Butcherab5df402016-06-11 02:31:21 +0100398 * \def MBEDTLS_TEST_NULL_ENTROPY
Janos Follath53de7842016-06-08 15:29:18 +0100399 *
Simon Butcherab5df402016-06-11 02:31:21 +0100400 * Enables testing and use of mbed TLS without any configured entropy sources.
401 * This permits use of the library on platforms before an entropy source has
402 * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the
403 * MBEDTLS_ENTROPY_NV_SEED switches).
404 *
405 * WARNING! This switch MUST be disabled in production builds, and is suitable
406 * only for development.
407 * Enabling the switch negates any security provided by the library.
Janos Follath53de7842016-06-08 15:29:18 +0100408 *
Janos Follathf93b8bc2016-06-09 13:54:15 +0100409 * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
410 *
Janos Follath53de7842016-06-08 15:29:18 +0100411 */
Simon Butcherab5df402016-06-11 02:31:21 +0100412//#define MBEDTLS_TEST_NULL_ENTROPY
Janos Follath53de7842016-06-08 15:29:18 +0100413
414/**
Manuel Pégourié-Gonnard8ba88f02015-06-22 12:14:20 +0200415 * \def MBEDTLS_ENTROPY_HARDWARE_ALT
Manuel Pégourié-Gonnard3f77dfb2015-06-19 10:06:21 +0200416 *
417 * Uncomment this macro to let mbed TLS use your own implementation of a
418 * hardware entropy collector.
419 *
420 * Your function must be called \c mbedtls_hardware_poll(), have the same
421 * prototype as declared in entropy_poll.h, and accept NULL as first argument.
422 *
423 * Uncomment to use your own hardware entropy collector.
424 */
425//#define MBEDTLS_ENTROPY_HARDWARE_ALT
426
427/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200428 * \def MBEDTLS_AES_ROM_TABLES
Paul Bakker15566e42011-04-24 21:19:15 +0000429 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100430 * Use precomputed AES tables stored in ROM.
Paul Bakker15566e42011-04-24 21:19:15 +0000431 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100432 * Uncomment this macro to use precomputed AES tables stored in ROM.
433 * Comment this macro to generate AES tables in RAM at runtime.
434 *
Hanno Becker4c1dc3c2018-03-27 16:52:03 +0100435 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
436 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
Hanno Becker6a92ce62018-03-28 11:42:05 +0100437 * initialization time before the first AES operation can be performed.
438 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
439 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
440 * performance if ROM access is slower than RAM access.
Hanno Becker177d3cf2017-06-07 15:52:48 +0100441 *
442 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
443 *
Paul Bakker15566e42011-04-24 21:19:15 +0000444 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200445//#define MBEDTLS_AES_ROM_TABLES
Paul Bakker15566e42011-04-24 21:19:15 +0000446
447/**
Hanno Becker177d3cf2017-06-07 15:52:48 +0100448 * \def MBEDTLS_AES_FEWER_TABLES
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200449 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100450 * Use less ROM/RAM for AES tables.
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200451 *
Hanno Becker177d3cf2017-06-07 15:52:48 +0100452 * Uncommenting this macro omits 75% of the AES tables from
453 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
454 * by computing their values on the fly during operations
455 * (the tables are entry-wise rotations of one another).
456 *
457 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
Hanno Becker08a5c182017-06-19 16:33:58 +0100458 * by ~6kb but at the cost of more arithmetic operations during
Hanno Becker177d3cf2017-06-07 15:52:48 +0100459 * runtime. Specifically, one has to compare 4 accesses within
460 * different tables to 4 accesses with additional arithmetic
461 * operations within the same table. The performance gain/loss
462 * depends on the system and memory details.
463 *
464 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
465 *
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200466 */
Hanno Becker177d3cf2017-06-07 15:52:48 +0100467//#define MBEDTLS_AES_FEWER_TABLES
Jussi Kivilinna2fd1bb82015-11-12 16:38:31 +0200468
469/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200470 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
Manuel Pégourié-Gonnard62edcc82015-04-03 16:28:19 +0200471 *
472 * Use less ROM for the Camellia implementation (saves about 768 bytes).
473 *
474 * Uncomment this macro to use less memory for Camellia.
475 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200476//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
Manuel Pégourié-Gonnard62edcc82015-04-03 16:28:19 +0200477
478/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200479 * \def MBEDTLS_CIPHER_MODE_CBC
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200480 *
481 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
482 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200483#define MBEDTLS_CIPHER_MODE_CBC
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200484
485/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200486 * \def MBEDTLS_CIPHER_MODE_CFB
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000487 *
488 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
489 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200490#define MBEDTLS_CIPHER_MODE_CFB
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000491
492/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200493 * \def MBEDTLS_CIPHER_MODE_CTR
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000494 *
495 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
496 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200497#define MBEDTLS_CIPHER_MODE_CTR
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000498
499/**
Jaeden Ameroff2f4932018-06-14 11:38:50 +0100500 * \def MBEDTLS_CIPHER_MODE_OFB
501 *
502 * Enable Output Feedback mode (OFB) for symmetric ciphers.
503 */
504#define MBEDTLS_CIPHER_MODE_OFB
505
506/**
507 * \def MBEDTLS_CIPHER_MODE_XTS
508 *
509 * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES.
510 */
511#define MBEDTLS_CIPHER_MODE_XTS
512
513/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200514 * \def MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +0000515 *
516 * Enable NULL cipher.
517 * Warning: Only do so when you know what you are doing. This allows for
518 * encryption or channels without any security!
519 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200520 * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable
Paul Bakkerfab5c822012-02-06 16:45:10 +0000521 * the following ciphersuites:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200522 * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
523 * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
524 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
525 * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
526 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
527 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
528 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
529 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
530 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
531 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
532 * MBEDTLS_TLS_RSA_WITH_NULL_SHA256
533 * MBEDTLS_TLS_RSA_WITH_NULL_SHA
534 * MBEDTLS_TLS_RSA_WITH_NULL_MD5
535 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384
536 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256
537 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA
538 * MBEDTLS_TLS_PSK_WITH_NULL_SHA384
539 * MBEDTLS_TLS_PSK_WITH_NULL_SHA256
540 * MBEDTLS_TLS_PSK_WITH_NULL_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000541 *
542 * Uncomment this macro to enable the NULL cipher and ciphersuites
Paul Bakkerfab5c822012-02-06 16:45:10 +0000543 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200544//#define MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +0000545
546/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100547 * \def MBEDTLS_CIPHER_PADDING_PKCS7
Paul Bakker48e93c82013-08-14 12:21:18 +0200548 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100549 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
550 * specific padding modes in the cipher layer with cipher modes that support
551 * padding (e.g. CBC)
Paul Bakker48e93c82013-08-14 12:21:18 +0200552 *
553 * If you disable all padding modes, only full blocks can be used with CBC.
554 *
555 * Enable padding modes in the cipher layer.
556 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200557#define MBEDTLS_CIPHER_PADDING_PKCS7
558#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
559#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
560#define MBEDTLS_CIPHER_PADDING_ZEROS
Paul Bakker48e93c82013-08-14 12:21:18 +0200561
562/**
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100563 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200564 *
Manuel Pégourié-Gonnard76da60c2016-01-04 13:51:01 +0100565 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
566 * module. By default all supported curves are enabled.
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200567 *
568 * Comment macros to disable the curve and functions for it
569 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200570#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
571#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
572#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
573#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
574#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
575#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
576#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
577#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
578#define MBEDTLS_ECP_DP_BP256R1_ENABLED
579#define MBEDTLS_ECP_DP_BP384R1_ENABLED
580#define MBEDTLS_ECP_DP_BP512R1_ENABLED
Manuel Pégourié-Gonnard07894332015-06-23 00:18:41 +0200581#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
Nicholas Wilson08f3ef12015-11-10 13:10:01 +0000582#define MBEDTLS_ECP_DP_CURVE448_ENABLED
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200583
584/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200585 * \def MBEDTLS_ECP_NIST_OPTIM
Manuel Pégourié-Gonnardc04c5302013-10-23 16:11:52 +0200586 *
587 * Enable specific 'modulo p' routines for each NIST prime.
588 * Depending on the prime and architecture, makes operations 4 to 8 times
589 * faster on the corresponding curve.
590 *
591 * Comment this macro to disable NIST curves optimisation.
592 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200593#define MBEDTLS_ECP_NIST_OPTIM
Manuel Pégourié-Gonnardc04c5302013-10-23 16:11:52 +0200594
595/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200596 * \def MBEDTLS_ECDSA_DETERMINISTIC
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100597 *
598 * Enable deterministic ECDSA (RFC 6979).
599 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
600 * may result in a compromise of the long-term signing key. This is avoided by
601 * the deterministic variant.
602 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200603 * Requires: MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard5b1a5732014-01-07 16:46:17 +0100604 *
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100605 * Comment this macro to disable deterministic ECDSA.
606 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200607#define MBEDTLS_ECDSA_DETERMINISTIC
Manuel Pégourié-Gonnard461d4162014-01-06 10:16:28 +0100608
609/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200610 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
Manuel Pégourié-Gonnard6fac3512014-03-19 16:39:52 +0100611 *
612 * Enhance support for reading EC keys using variants of SEC1 not allowed by
613 * RFC 5915 and RFC 5480.
614 *
615 * Currently this means parsing the SpecifiedECDomain choice of EC
616 * parameters (only known groups are supported, not arbitrary domains, to
617 * avoid validation issues).
618 *
619 * Disable if you only need to support RFC 5915 + 5480 key formats.
620 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200621#define MBEDTLS_PK_PARSE_EC_EXTENDED
Manuel Pégourié-Gonnard6fac3512014-03-19 16:39:52 +0100622
623/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200624 * \def MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100625 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200626 * Enable a dummy error function to make use of mbedtls_strerror() in
627 * third party libraries easier when MBEDTLS_ERROR_C is disabled
628 * (no effect when MBEDTLS_ERROR_C is enabled).
Manuel Pégourié-Gonnarddc16aa72014-06-25 12:55:12 +0200629 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200630 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
631 * not using mbedtls_strerror() or error_strerror() in your application.
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100632 *
633 * Disable if you run into name conflicts and want to really remove the
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200634 * mbedtls_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100635 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200636#define MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100637
638/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200639 * \def MBEDTLS_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000640 *
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200641 * Enable the prime-number generation code.
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200642 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200643 * Requires: MBEDTLS_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000644 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200645#define MBEDTLS_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000646
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000647/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200648 * \def MBEDTLS_FS_IO
Paul Bakker335db3f2011-04-25 15:28:35 +0000649 *
650 * Enable functions that use the filesystem.
651 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200652#define MBEDTLS_FS_IO
Paul Bakker335db3f2011-04-25 15:28:35 +0000653
654/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200655 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
Paul Bakker43655f42011-12-15 20:11:16 +0000656 *
657 * Do not add default entropy sources. These are the platform specific,
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200658 * mbedtls_timing_hardclock and HAVEGE based poll functions.
Paul Bakker43655f42011-12-15 20:11:16 +0000659 *
Shuo Chen95a0d112014-04-04 21:04:40 -0700660 * This is useful to have more control over the added entropy sources in an
Paul Bakker43655f42011-12-15 20:11:16 +0000661 * application.
662 *
663 * Uncomment this macro to prevent loading of default entropy functions.
Paul Bakker43655f42011-12-15 20:11:16 +0000664 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200665//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
Paul Bakker43655f42011-12-15 20:11:16 +0000666
667/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200668 * \def MBEDTLS_NO_PLATFORM_ENTROPY
Paul Bakker6083fd22011-12-03 21:45:14 +0000669 *
670 * Do not use built-in platform entropy functions.
671 * This is useful if your platform does not support
672 * standards like the /dev/urandom or Windows CryptoAPI.
673 *
674 * Uncomment this macro to disable the built-in platform entropy functions.
Paul Bakker6083fd22011-12-03 21:45:14 +0000675 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200676//#define MBEDTLS_NO_PLATFORM_ENTROPY
Paul Bakker6083fd22011-12-03 21:45:14 +0000677
678/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200679 * \def MBEDTLS_ENTROPY_FORCE_SHA256
Paul Bakker2ceda572014-02-06 15:55:25 +0100680 *
681 * Force the entropy accumulator to use a SHA-256 accumulator instead of the
682 * default SHA-512 based one (if both are available).
683 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200684 * Requires: MBEDTLS_SHA256_C
Paul Bakker2ceda572014-02-06 15:55:25 +0100685 *
686 * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
687 * if you have performance concerns.
688 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200689 * This option is only useful if both MBEDTLS_SHA256_C and
690 * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
Paul Bakker2ceda572014-02-06 15:55:25 +0100691 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200692//#define MBEDTLS_ENTROPY_FORCE_SHA256
Paul Bakker2ceda572014-02-06 15:55:25 +0100693
694/**
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100695 * \def MBEDTLS_ENTROPY_NV_SEED
696 *
697 * Enable the non-volatile (NV) seed file-based entropy source.
698 * (Also enables the NV seed read/write functions in the platform layer)
699 *
700 * This is crucial (if not required) on systems that do not have a
701 * cryptographic entropy source (in hardware or kernel) available.
702 *
703 * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
704 *
Paul Bakker71a597a2016-06-07 10:59:03 +0100705 * \note The read/write functions that are used by the entropy source are
706 * determined in the platform layer, and can be modified at runtime and/or
707 * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
708 *
709 * \note If you use the default implementation functions that read a seedfile
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100710 * with regular fopen(), please make sure you make a seedfile with the
711 * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
712 * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
Paul Bakker71a597a2016-06-07 10:59:03 +0100713 * and written to or you will get an entropy source error! The default
714 * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
715 * bytes from the file.
716 *
717 * \note The entropy collector will write to the seed file before entropy is
718 * given to an external source, to update it.
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100719 */
720//#define MBEDTLS_ENTROPY_NV_SEED
721
722/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200723 * \def MBEDTLS_MEMORY_DEBUG
Paul Bakker6e339b52013-07-03 13:37:05 +0200724 *
725 * Enable debugging of buffer allocator memory issues. Automatically prints
726 * (to stderr) all (fatal) messages on memory allocation issues. Enables
727 * function for 'debug output' of allocated memory.
728 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200729 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +0200730 *
731 * Uncomment this macro to let the buffer allocator print out error messages.
Paul Bakkera7ea6a52013-10-15 11:55:10 +0200732 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200733//#define MBEDTLS_MEMORY_DEBUG
Paul Bakker6e339b52013-07-03 13:37:05 +0200734
735/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200736 * \def MBEDTLS_MEMORY_BACKTRACE
Paul Bakker6e339b52013-07-03 13:37:05 +0200737 *
738 * Include backtrace information with each allocated block.
739 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200740 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +0200741 * GLIBC-compatible backtrace() an backtrace_symbols() support
742 *
743 * Uncomment this macro to include backtrace information
Paul Bakker6e339b52013-07-03 13:37:05 +0200744 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200745//#define MBEDTLS_MEMORY_BACKTRACE
Paul Bakker6e339b52013-07-03 13:37:05 +0200746
747/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200748 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +0200749 *
750 * Support external private RSA keys (eg from a HSM) in the PK layer.
751 *
752 * Comment this macro to disable support for external private RSA keys.
753 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200754#define MBEDTLS_PK_RSA_ALT_SUPPORT
Manuel Pégourié-Gonnard348bcb32015-03-31 14:01:33 +0200755
756/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200757 * \def MBEDTLS_PKCS1_V15
Paul Bakker48377d92013-08-30 12:06:24 +0200758 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200759 * Enable support for PKCS#1 v1.5 encoding.
760 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200761 * Requires: MBEDTLS_RSA_C
Paul Bakker48377d92013-08-30 12:06:24 +0200762 *
Paul Bakker48377d92013-08-30 12:06:24 +0200763 * This enables support for PKCS#1 v1.5 operations.
764 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200765#define MBEDTLS_PKCS1_V15
Paul Bakker48377d92013-08-30 12:06:24 +0200766
767/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200768 * \def MBEDTLS_PKCS1_V21
Paul Bakker9dcc3222011-03-08 14:16:06 +0000769 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200770 * Enable support for PKCS#1 v2.1 encoding.
771 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200772 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
Paul Bakker5690efc2011-05-26 13:16:06 +0000773 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000774 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
775 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200776#define MBEDTLS_PKCS1_V21
Paul Bakker9dcc3222011-03-08 14:16:06 +0000777
778/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200779 * \def MBEDTLS_RSA_NO_CRT
Paul Bakker0216cc12011-03-26 13:40:23 +0000780 *
Gilles Peskine66920ce2018-03-03 21:49:49 +0100781 * Do not use the Chinese Remainder Theorem for the RSA private operation.
Paul Bakker0216cc12011-03-26 13:40:23 +0000782 *
783 * Uncomment this macro to disable the use of CRT in RSA.
784 *
Paul Bakker0216cc12011-03-26 13:40:23 +0000785 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200786//#define MBEDTLS_RSA_NO_CRT
Paul Bakker15566e42011-04-24 21:19:15 +0000787
788/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200789 * \def MBEDTLS_SELF_TEST
Paul Bakker15566e42011-04-24 21:19:15 +0000790 *
791 * Enable the checkup functions (*_self_test).
792 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200793#define MBEDTLS_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000794
795/**
Manuel Pégourié-Gonnardeb0d8702015-05-28 12:54:04 +0200796 * \def MBEDTLS_SHA256_SMALLER
797 *
798 * Enable an implementation of SHA-256 that has lower ROM footprint but also
799 * lower performance.
800 *
801 * The default implementation is meant to be a reasonnable compromise between
802 * performance and size. This version optimizes more aggressively for size at
803 * the expense of performance. Eg on Cortex-M4 it reduces the size of
804 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
805 * 30%.
806 *
807 * Uncomment to enable the smaller implementation of SHA256.
808 */
809//#define MBEDTLS_SHA256_SMALLER
810
811/**
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200812 * \def MBEDTLS_SSL_ASYNC_PRIVATE
813 *
814 * Enable asynchronous external private key operations in SSL. This allows
815 * you to configure an SSL connection to call an external cryptographic
816 * module to perform private key operations instead of performing the
817 * operation inside the library.
818 *
819 */
Jaeden Amerod9c71da2018-06-15 20:31:26 +0100820//#define MBEDTLS_SSL_ASYNC_PRIVATE
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200821
822/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200823 * \def MBEDTLS_THREADING_ALT
Paul Bakker2466d932013-09-28 14:40:38 +0200824 *
825 * Provide your own alternate threading implementation.
826 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200827 * Requires: MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +0200828 *
829 * Uncomment this to allow your own alternate threading implementation.
Paul Bakker2466d932013-09-28 14:40:38 +0200830 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200831//#define MBEDTLS_THREADING_ALT
Paul Bakker2466d932013-09-28 14:40:38 +0200832
833/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200834 * \def MBEDTLS_THREADING_PTHREAD
Paul Bakker2466d932013-09-28 14:40:38 +0200835 *
836 * Enable the pthread wrapper layer for the threading layer.
837 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200838 * Requires: MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +0200839 *
840 * Uncomment this to enable pthread mutexes.
Paul Bakker2466d932013-09-28 14:40:38 +0200841 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200842//#define MBEDTLS_THREADING_PTHREAD
Paul Bakker2466d932013-09-28 14:40:38 +0200843
844/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200845 * \def MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200846 *
847 * Allow run-time checking of compile-time enabled features. Thus allowing users
848 * to check at run-time if the library is for instance compiled with threading
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200849 * support via mbedtls_version_check_feature().
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200850 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200851 * Requires: MBEDTLS_VERSION_C
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200852 *
853 * Comment this to disable run-time checking and save ROM space
854 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200855#define MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200856
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000857/* \} name SECTION: mbed TLS feature support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000858
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000859/**
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000860 * \name SECTION: mbed TLS modules
Paul Bakker0a62cd12011-01-21 11:00:08 +0000861 *
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +0000862 * This section enables or disables entire modules in mbed TLS
Paul Bakker0a62cd12011-01-21 11:00:08 +0000863 * \{
864 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000865
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000866/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200867 * \def MBEDTLS_AESNI_C
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +0100868 *
869 * Enable AES-NI support on x86-64.
870 *
871 * Module: library/aesni.c
872 * Caller: library/aes.c
873 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200874 * Requires: MBEDTLS_HAVE_ASM
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +0100875 *
876 * This modules adds support for the AES-NI instructions on x86-64
877 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200878#define MBEDTLS_AESNI_C
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +0100879
880/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200881 * \def MBEDTLS_AES_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000882 *
883 * Enable the AES block cipher.
884 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000885 * Module: library/aes.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +0100886 * Caller: library/cipher.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000887 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000888 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000889 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000890 * This module enables the following ciphersuites (if other requisites are
891 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200892 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
893 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
894 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
895 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
896 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
897 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
898 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
899 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
900 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
901 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
902 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
903 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
904 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
905 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
906 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
907 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
908 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
909 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
910 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
911 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
912 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
913 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
914 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
915 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
916 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
917 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
918 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
919 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
920 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
921 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
922 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
923 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
924 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
925 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
926 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
927 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
928 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
929 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
930 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
931 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
932 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
933 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
934 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
935 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
936 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
937 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
938 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
939 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
940 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
941 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
942 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
943 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
944 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
945 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
946 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
947 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
948 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
949 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100950 *
Paul Bakkercff68422013-09-15 20:43:33 +0200951 * PEM_PARSE uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000952 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200953#define MBEDTLS_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000954
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000955/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200956 * \def MBEDTLS_ARC4_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000957 *
958 * Enable the ARCFOUR stream cipher.
959 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000960 * Module: library/arc4.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +0100961 * Caller: library/cipher.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000962 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100963 * This module enables the following ciphersuites (if other requisites are
964 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200965 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
966 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
967 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
968 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
969 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
970 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
971 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
972 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
973 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
974 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100975 *
976 * \warning ARC4 is considered a weak cipher and its use constitutes a
977 * security risk. If possible, we recommend avoidng dependencies on
978 * it, and considering stronger ciphers instead.
979 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000980 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200981#define MBEDTLS_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000982
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000983/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200984 * \def MBEDTLS_ASN1_PARSE_C
Paul Bakkerefc30292011-11-10 14:43:23 +0000985 *
986 * Enable the generic ASN1 parser.
987 *
988 * Module: library/asn1.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200989 * Caller: library/x509.c
990 * library/dhm.c
991 * library/pkcs12.c
992 * library/pkcs5.c
993 * library/pkparse.c
Paul Bakkerefc30292011-11-10 14:43:23 +0000994 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200995#define MBEDTLS_ASN1_PARSE_C
Paul Bakkerefc30292011-11-10 14:43:23 +0000996
997/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200998 * \def MBEDTLS_ASN1_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000999 *
1000 * Enable the generic ASN1 writer.
1001 *
1002 * Module: library/asn1write.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001003 * Caller: library/ecdsa.c
1004 * library/pkwrite.c
1005 * library/x509_create.c
1006 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001007 * library/x509write_csr.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001008 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001009#define MBEDTLS_ASN1_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001010
1011/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001012 * \def MBEDTLS_BASE64_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001013 *
1014 * Enable the Base64 module.
1015 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001016 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001017 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001018 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001019 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +00001020 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001021#define MBEDTLS_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001022
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001023/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001024 * \def MBEDTLS_BIGNUM_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001025 *
Paul Bakker9a736322012-11-14 12:39:52 +00001026 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001027 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001028 * Module: library/bignum.c
1029 * Caller: library/dhm.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001030 * library/ecp.c
Manuel Pégourié-Gonnardbf319772014-06-25 13:00:17 +02001031 * library/ecdsa.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001032 * library/rsa.c
Hanno Beckera565f542017-10-11 11:00:19 +01001033 * library/rsa_internal.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001034 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001035 *
Manuel Pégourié-Gonnardbf319772014-06-25 13:00:17 +02001036 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
Paul Bakker5121ce52009-01-03 21:22:43 +00001037 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001038#define MBEDTLS_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001039
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001040/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001041 * \def MBEDTLS_BLOWFISH_C
Paul Bakkera9379c02012-07-04 11:02:11 +00001042 *
1043 * Enable the Blowfish block cipher.
1044 *
1045 * Module: library/blowfish.c
1046 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001047#define MBEDTLS_BLOWFISH_C
Paul Bakkera9379c02012-07-04 11:02:11 +00001048
1049/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001050 * \def MBEDTLS_CAMELLIA_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001051 *
1052 * Enable the Camellia block cipher.
1053 *
Paul Bakker38119b12009-01-10 23:31:23 +00001054 * Module: library/camellia.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +01001055 * Caller: library/cipher.c
Paul Bakker38119b12009-01-10 23:31:23 +00001056 *
Paul Bakker645ce3a2012-10-31 12:32:41 +00001057 * This module enables the following ciphersuites (if other requisites are
1058 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001059 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1060 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1061 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
1062 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
1063 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1064 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1065 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
1066 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
1067 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1068 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1069 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1070 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1071 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
1072 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
1073 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
1074 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1075 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1076 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1077 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1078 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1079 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1080 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1081 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
1082 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1083 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1084 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
1085 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1086 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1087 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1088 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
1089 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
1090 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
1091 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
1092 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
1093 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
1094 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
1095 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
1096 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
1097 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
1098 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
1099 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
1100 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +00001101 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001102#define MBEDTLS_CAMELLIA_C
Paul Bakker38119b12009-01-10 23:31:23 +00001103
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001104/**
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001105 * \def MBEDTLS_ARIA_C
1106 *
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001107 * Enable the ARIA block cipher.
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001108 *
1109 * Module: library/aria.c
Manuel Pégourié-Gonnard525168c2018-02-28 10:47:02 +01001110 * Caller: library/cipher.c
1111 *
1112 * This module enables the following ciphersuites (if other requisites are
1113 * enabled as well):
1114 *
1115 * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256
1116 * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384
1117 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256
1118 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384
1119 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256
1120 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384
1121 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256
1122 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384
1123 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256
1124 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384
1125 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256
1126 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384
1127 * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256
1128 * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384
1129 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256
1130 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384
1131 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256
1132 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384
1133 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256
1134 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384
1135 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256
1136 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384
1137 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256
1138 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384
1139 * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256
1140 * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384
1141 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256
1142 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384
1143 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256
1144 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384
1145 * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256
1146 * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384
1147 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256
1148 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384
1149 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256
1150 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384
1151 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256
1152 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001153 */
Manuel Pégourié-Gonnard2268b962018-02-27 12:22:36 +01001154//#define MBEDTLS_ARIA_C
Markku-Juhani O. Saarinen3c0b53b2017-11-30 16:00:34 +00001155
1156/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001157 * \def MBEDTLS_CCM_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001158 *
1159 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
1160 *
1161 * Module: library/ccm.c
1162 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001163 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001164 *
1165 * This module enables the AES-CCM ciphersuites, if other requisites are
1166 * enabled as well.
1167 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001168#define MBEDTLS_CCM_C
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +02001169
1170/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001171 * \def MBEDTLS_CERTS_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001172 *
1173 * Enable the test certificates.
1174 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001175 * Module: library/certs.c
1176 * Caller:
1177 *
1178 * This module is used for testing (ssl_client/server).
1179 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001180#define MBEDTLS_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001181
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001182/**
Daniel King34b822c2016-05-15 17:28:08 -03001183 * \def MBEDTLS_CHACHA20_C
1184 *
1185 * Enable the ChaCha20 stream cipher.
1186 *
1187 * Module: library/chacha20.c
1188 */
1189#define MBEDTLS_CHACHA20_C
1190
1191/**
Manuel Pégourié-Gonnarde533b222018-06-04 12:23:19 +02001192 * \def MBEDTLS_CHACHAPOLY_C
1193 *
1194 * Enable the ChaCha20-Poly1305 AEAD algorithm.
1195 *
1196 * Module: library/chachapoly.c
1197 *
1198 * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
1199 */
1200#define MBEDTLS_CHACHAPOLY_C
1201
1202/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001203 * \def MBEDTLS_CIPHER_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001204 *
1205 * Enable the generic cipher layer.
1206 *
Paul Bakker8123e9d2011-01-06 15:37:30 +00001207 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +02001208 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +00001209 *
1210 * Uncomment to enable generic cipher wrappers.
1211 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001212#define MBEDTLS_CIPHER_C
Paul Bakker8123e9d2011-01-06 15:37:30 +00001213
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001214/**
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001215 * \def MBEDTLS_CMAC_C
1216 *
Simon Butcher327398a2016-10-05 14:09:11 +01001217 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
1218 * ciphers.
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001219 *
1220 * Module: library/cmac.c
1221 *
Simon Butcher69283e52016-10-06 12:49:58 +01001222 * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001223 *
1224 */
Gilles Peskinee59236f2018-01-27 23:32:46 +01001225#define MBEDTLS_CMAC_C
Robert Cragiedc5c7b92015-12-11 15:49:45 +00001226
1227/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001228 * \def MBEDTLS_CTR_DRBG_C
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001229 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001230 * Enable the CTR_DRBG AES-256-based random generator.
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001231 *
1232 * Module: library/ctr_drbg.c
1233 * Caller:
1234 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001235 * Requires: MBEDTLS_AES_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001236 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001237 * This module provides the CTR_DRBG AES-256 random number generator.
1238 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001239#define MBEDTLS_CTR_DRBG_C
Paul Bakker0e04d0e2011-11-27 14:46:59 +00001240
1241/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001242 * \def MBEDTLS_DES_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001243 *
1244 * Enable the DES block cipher.
1245 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001246 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001247 * Caller: library/pem.c
Manuel Pégourié-Gonnardfdd43542018-02-28 10:49:02 +01001248 * library/cipher.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001249 *
Paul Bakker645ce3a2012-10-31 12:32:41 +00001250 * This module enables the following ciphersuites (if other requisites are
1251 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001252 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
1253 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
1254 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
1255 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
1256 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
1257 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
1258 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
1259 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
1260 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
1261 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +01001262 *
Paul Bakkercff68422013-09-15 20:43:33 +02001263 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001264 *
1265 * \warning DES is considered a weak cipher and its use constitutes a
1266 * security risk. We recommend considering stronger ciphers instead.
Paul Bakker5121ce52009-01-03 21:22:43 +00001267 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001268#define MBEDTLS_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001269
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001270/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001271 * \def MBEDTLS_DHM_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001272 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001273 * Enable the Diffie-Hellman-Merkle module.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001274 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001275 * Module: library/dhm.c
1276 * Caller: library/ssl_cli.c
1277 * library/ssl_srv.c
1278 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001279 * This module is used by the following key exchanges:
1280 * DHE-RSA, DHE-PSK
Hanno Beckera2f6b722017-09-28 10:33:29 +01001281 *
Hanno Beckerf9734b32017-10-03 12:09:22 +01001282 * \warning Using DHE constitutes a security risk as it
1283 * is not possible to validate custom DH parameters.
1284 * If possible, it is recommended users should consider
1285 * preferring other methods of key exchange.
1286 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +01001287 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001288 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001289#define MBEDTLS_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001290
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001291/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001292 * \def MBEDTLS_ECDH_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001293 *
1294 * Enable the elliptic curve Diffie-Hellman library.
1295 *
1296 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +01001297 * Caller: library/ssl_cli.c
1298 * library/ssl_srv.c
1299 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001300 * This module is used by the following key exchanges:
1301 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001302 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001303 * Requires: MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001304 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001305#define MBEDTLS_ECDH_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001306
1307/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001308 * \def MBEDTLS_ECDSA_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001309 *
1310 * Enable the elliptic curve DSA library.
1311 *
1312 * Module: library/ecdsa.c
1313 * Caller:
1314 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001315 * This module is used by the following key exchanges:
1316 * ECDHE-ECDSA
1317 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001318 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001319 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001320#define MBEDTLS_ECDSA_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001321
1322/**
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001323 * \def MBEDTLS_ECJPAKE_C
1324 *
1325 * Enable the elliptic curve J-PAKE library.
1326 *
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +02001327 * \warning This is currently experimental. EC J-PAKE support is based on the
1328 * Thread v1.0.0 specification; incompatible changes to the specification
1329 * might still happen. For this reason, this is disabled by default.
1330 *
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001331 * Module: library/ecjpake.c
1332 * Caller:
1333 *
1334 * This module is used by the following key exchanges:
1335 * ECJPAKE
1336 *
1337 * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
1338 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001339#define MBEDTLS_ECJPAKE_C
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001340
1341/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001342 * \def MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001343 *
1344 * Enable the elliptic curve over GF(p) library.
1345 *
1346 * Module: library/ecp.c
1347 * Caller: library/ecdh.c
1348 * library/ecdsa.c
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +02001349 * library/ecjpake.c
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001350 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001351 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001352 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001353#define MBEDTLS_ECP_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001354
1355/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001356 * \def MBEDTLS_ENTROPY_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001357 *
1358 * Enable the platform-specific entropy code.
1359 *
1360 * Module: library/entropy.c
1361 * Caller:
1362 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001363 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001364 *
1365 * This module provides a generic entropy pool
1366 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001367#define MBEDTLS_ENTROPY_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001368
1369/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001370 * \def MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +00001371 *
1372 * Enable error code to error string conversion.
1373 *
1374 * Module: library/error.c
1375 * Caller:
1376 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001377 * This module enables mbedtls_strerror().
Paul Bakker9d781402011-05-09 16:17:09 +00001378 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001379#define MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +00001380
1381/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001382 * \def MBEDTLS_GCM_C
Paul Bakker89e80c92012-03-20 13:50:09 +00001383 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001384 * Enable the Galois/Counter Mode (GCM) for AES.
Paul Bakker89e80c92012-03-20 13:50:09 +00001385 *
1386 * Module: library/gcm.c
1387 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001388 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
Paul Bakker645ce3a2012-10-31 12:32:41 +00001389 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001390 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
1391 * requisites are enabled as well.
Paul Bakker89e80c92012-03-20 13:50:09 +00001392 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001393#define MBEDTLS_GCM_C
Paul Bakker89e80c92012-03-20 13:50:09 +00001394
1395/**
Thomas Fossati656864b2016-07-17 08:51:22 +01001396 * \def MBEDTLS_HKDF_C
1397 *
1398 * Enable the HKDF algorithm (RFC 5869).
1399 *
1400 * Module: library/hkdf.c
1401 * Caller:
1402 *
1403 * Requires: MBEDTLS_MD_C
1404 *
1405 * This module adds support for the Hashed Message Authentication Code
1406 * (HMAC)-based key derivation function (HKDF).
1407 */
1408#define MBEDTLS_HKDF_C
1409
1410/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001411 * \def MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01001412 *
1413 * Enable the HMAC_DRBG random generator.
1414 *
1415 * Module: library/hmac_drbg.c
1416 * Caller:
1417 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001418 * Requires: MBEDTLS_MD_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01001419 *
1420 * Uncomment to enable the HMAC_DRBG random number geerator.
1421 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001422#define MBEDTLS_HMAC_DRBG_C
Manuel Pégourié-Gonnard490bdf32014-01-27 14:03:10 +01001423
1424/**
Ron Eldor466a57f2018-05-03 16:54:28 +03001425 * \def MBEDTLS_NIST_KW_C
1426 *
1427 * Enable the Key Wrapping mode for 128-bit block ciphers,
1428 * as defined in NIST SP 800-38F. Only KW and KWP modes
1429 * are supported. At the moment, only AES is approved by NIST.
1430 *
1431 * Module: library/nist_kw.c
1432 *
1433 * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C
1434 */
1435//#define MBEDTLS_NIST_KW_C
1436
1437/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001438 * \def MBEDTLS_MD_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001439 *
1440 * Enable the generic message digest layer.
1441 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001442 * Module: library/md.c
Paul Bakker17373852011-01-06 14:20:01 +00001443 * Caller:
1444 *
1445 * Uncomment to enable generic message digest wrappers.
1446 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001447#define MBEDTLS_MD_C
Paul Bakker17373852011-01-06 14:20:01 +00001448
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001449/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001450 * \def MBEDTLS_MD2_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001451 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001452 * Enable the MD2 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001453 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001454 * Module: library/md2.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001455 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001456 *
1457 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001458 *
1459 * \warning MD2 is considered a weak message digest and its use constitutes a
1460 * security risk. If possible, we recommend avoiding dependencies on
1461 * it, and considering stronger message digests instead.
1462 *
Paul Bakker6506aff2009-07-28 20:52:02 +00001463 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001464#define MBEDTLS_MD2_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001465
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001466/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001467 * \def MBEDTLS_MD4_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001468 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001469 * Enable the MD4 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001470 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001471 * Module: library/md4.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001472 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001473 *
1474 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001475 *
1476 * \warning MD4 is considered a weak message digest and its use constitutes a
1477 * security risk. If possible, we recommend avoiding dependencies on
1478 * it, and considering stronger message digests instead.
1479 *
Paul Bakker6506aff2009-07-28 20:52:02 +00001480 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001481#define MBEDTLS_MD4_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001482
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001483/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001484 * \def MBEDTLS_MD5_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001485 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001486 * Enable the MD5 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001487 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001488 * Module: library/md5.c
1489 * Caller: library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001490 * library/pem.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001491 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001492 *
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001493 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
1494 * depending on the handshake parameters. Further, it is used for checking
1495 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
1496 * encrypted keys.
1497 *
1498 * \warning MD5 is considered a weak message digest and its use constitutes a
1499 * security risk. If possible, we recommend avoiding dependencies on
1500 * it, and considering stronger message digests instead.
1501 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001502 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001503#define MBEDTLS_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001504
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001505/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001506 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001507 *
1508 * Enable the buffer allocator implementation that makes use of a (stack)
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02001509 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001510 * calls)
Paul Bakker6e339b52013-07-03 13:37:05 +02001511 *
1512 * Module: library/memory_buffer_alloc.c
1513 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001514 * Requires: MBEDTLS_PLATFORM_C
1515 * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
Paul Bakker6e339b52013-07-03 13:37:05 +02001516 *
1517 * Enable this module to enable the buffer memory allocator.
Paul Bakker6e339b52013-07-03 13:37:05 +02001518 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001519//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +02001520
1521/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001522 * \def MBEDTLS_OID_C
Paul Bakkerc70b9822013-04-07 22:00:46 +02001523 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001524 * Enable the OID database.
Paul Bakkerc70b9822013-04-07 22:00:46 +02001525 *
1526 * Module: library/oid.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001527 * Caller: library/asn1write.c
1528 * library/pkcs5.c
1529 * library/pkparse.c
1530 * library/pkwrite.c
1531 * library/rsa.c
1532 * library/x509.c
1533 * library/x509_create.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001534 * library/x509_crl.c
1535 * library/x509_crt.c
1536 * library/x509_csr.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001537 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001538 * library/x509write_csr.c
Paul Bakkerc70b9822013-04-07 22:00:46 +02001539 *
1540 * This modules translates between OIDs and internal values.
1541 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001542#define MBEDTLS_OID_C
Paul Bakkerc70b9822013-04-07 22:00:46 +02001543
1544/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001545 * \def MBEDTLS_PADLOCK_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001546 *
1547 * Enable VIA Padlock support on x86.
1548 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001549 * Module: library/padlock.c
1550 * Caller: library/aes.c
1551 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001552 * Requires: MBEDTLS_HAVE_ASM
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01001553 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001554 * This modules adds support for the VIA PadLock on x86.
1555 */
Gilles Peskine66920ce2018-03-03 21:49:49 +01001556//#define MBEDTLS_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001557
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001558/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001559 * \def MBEDTLS_PEM_PARSE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001560 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001561 * Enable PEM decoding / parsing.
Paul Bakker96743fc2011-02-12 14:30:57 +00001562 *
1563 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001564 * Caller: library/dhm.c
Paul Bakkercff68422013-09-15 20:43:33 +02001565 * library/pkparse.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001566 * library/x509_crl.c
1567 * library/x509_crt.c
1568 * library/x509_csr.c
Paul Bakker96743fc2011-02-12 14:30:57 +00001569 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001570 * Requires: MBEDTLS_BASE64_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001571 *
Paul Bakkercff68422013-09-15 20:43:33 +02001572 * This modules adds support for decoding / parsing PEM files.
Paul Bakker96743fc2011-02-12 14:30:57 +00001573 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001574#define MBEDTLS_PEM_PARSE_C
Paul Bakkercff68422013-09-15 20:43:33 +02001575
1576/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001577 * \def MBEDTLS_PEM_WRITE_C
Paul Bakkercff68422013-09-15 20:43:33 +02001578 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001579 * Enable PEM encoding / writing.
Paul Bakkercff68422013-09-15 20:43:33 +02001580 *
1581 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001582 * Caller: library/pkwrite.c
1583 * library/x509write_crt.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001584 * library/x509write_csr.c
Paul Bakkercff68422013-09-15 20:43:33 +02001585 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001586 * Requires: MBEDTLS_BASE64_C
Paul Bakkercff68422013-09-15 20:43:33 +02001587 *
1588 * This modules adds support for encoding / writing PEM files.
1589 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001590#define MBEDTLS_PEM_WRITE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001591
1592/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001593 * \def MBEDTLS_PK_C
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001594 *
1595 * Enable the generic public (asymetric) key layer.
1596 *
1597 * Module: library/pk.c
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001598 * Caller: library/ssl_tls.c
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001599 * library/ssl_cli.c
1600 * library/ssl_srv.c
1601 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001602 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001603 *
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001604 * Uncomment to enable generic public key wrappers.
1605 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001606#define MBEDTLS_PK_C
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001607
1608/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001609 * \def MBEDTLS_PK_PARSE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001610 *
1611 * Enable the generic public (asymetric) key parser.
1612 *
1613 * Module: library/pkparse.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001614 * Caller: library/x509_crt.c
1615 * library/x509_csr.c
Paul Bakker4606c732013-09-15 17:04:23 +02001616 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001617 * Requires: MBEDTLS_PK_C
Paul Bakker4606c732013-09-15 17:04:23 +02001618 *
1619 * Uncomment to enable generic public key parse functions.
1620 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001621#define MBEDTLS_PK_PARSE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001622
1623/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001624 * \def MBEDTLS_PK_WRITE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001625 *
Paul Bakkerf20ba4b2013-09-16 22:46:20 +02001626 * Enable the generic public (asymetric) key writer.
Paul Bakker4606c732013-09-15 17:04:23 +02001627 *
1628 * Module: library/pkwrite.c
1629 * Caller: library/x509write.c
1630 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001631 * Requires: MBEDTLS_PK_C
Paul Bakker4606c732013-09-15 17:04:23 +02001632 *
1633 * Uncomment to enable generic public key write functions.
1634 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001635#define MBEDTLS_PK_WRITE_C
Paul Bakker4606c732013-09-15 17:04:23 +02001636
1637/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001638 * \def MBEDTLS_PKCS5_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001639 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001640 * Enable PKCS#5 functions.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001641 *
1642 * Module: library/pkcs5.c
1643 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001644 * Requires: MBEDTLS_MD_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001645 *
1646 * This module adds support for the PKCS#5 functions.
1647 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001648#define MBEDTLS_PKCS5_C
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001649
1650/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001651 * \def MBEDTLS_PKCS11_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001652 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001653 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001654 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001655 * Module: library/pkcs11.c
1656 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001657 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001658 * Requires: MBEDTLS_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001659 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001660 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001661 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
Paul Bakker5690efc2011-05-26 13:16:06 +00001662 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001663//#define MBEDTLS_PKCS11_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001664
1665/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001666 * \def MBEDTLS_PKCS12_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001667 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001668 * Enable PKCS#12 PBE functions.
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001669 * Adds algorithms for parsing PKCS#8 encrypted private keys
1670 *
1671 * Module: library/pkcs12.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001672 * Caller: library/pkparse.c
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001673 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001674 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
1675 * Can use: MBEDTLS_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001676 *
1677 * This module enables PKCS#12 functions.
1678 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001679#define MBEDTLS_PKCS12_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001680
1681/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001682 * \def MBEDTLS_PLATFORM_C
Paul Bakker747a83a2014-02-01 22:50:07 +01001683 *
1684 * Enable the platform abstraction layer that allows you to re-assign
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001685 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
Paul Bakker747a83a2014-02-01 22:50:07 +01001686 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001687 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
1688 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
Rich Evans16f8cd82015-02-06 16:14:34 +00001689 * above to be specified at runtime or compile time respectively.
Paul Bakker747a83a2014-02-01 22:50:07 +01001690 *
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001691 * \note This abstraction layer must be enabled on Windows (including MSYS2)
1692 * as other module rely on it for a fixed snprintf implementation.
1693 *
Paul Bakker747a83a2014-02-01 22:50:07 +01001694 * Module: library/platform.c
1695 * Caller: Most other .c files
1696 *
1697 * This module enables abstraction of common (libc) functions.
1698 */
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02001699#define MBEDTLS_PLATFORM_C
Paul Bakker747a83a2014-02-01 22:50:07 +01001700
1701/**
Daniel Kingadc32c02016-05-16 18:25:45 -03001702 * \def MBEDTLS_POLY1305_C
1703 *
1704 * Enable the Poly1305 MAC algorithm.
1705 *
1706 * Module: library/poly1305.c
Manuel Pégourié-Gonnarddca3a5d2018-05-07 10:43:27 +02001707 * Caller: library/chachapoly.c
Daniel Kingadc32c02016-05-16 18:25:45 -03001708 */
1709#define MBEDTLS_POLY1305_C
1710
1711/**
Gilles Peskinee59236f2018-01-27 23:32:46 +01001712* \def MBEDTLS_PSA_CRYPTO_C
1713 *
1714 * Enable the Platform Security Architecture cryptography API.
1715 *
1716 * Module: library/psa_crypto.c
1717 *
1718 * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C
1719 *
1720 */
1721#define MBEDTLS_PSA_CRYPTO_C
1722
1723/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001724 * \def MBEDTLS_RIPEMD160_C
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01001725 *
1726 * Enable the RIPEMD-160 hash algorithm.
1727 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001728 * Module: library/ripemd160.c
1729 * Caller: library/md.c
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01001730 *
1731 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001732#define MBEDTLS_RIPEMD160_C
Manuel Pégourié-Gonnardcab4a882014-01-17 12:42:35 +01001733
1734/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001735 * \def MBEDTLS_RSA_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001736 *
1737 * Enable the RSA public-key cryptosystem.
1738 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001739 * Module: library/rsa.c
Hanno Beckera565f542017-10-11 11:00:19 +01001740 * library/rsa_internal.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001741 * Caller: library/ssl_cli.c
1742 * library/ssl_srv.c
1743 * library/ssl_tls.c
1744 * library/x509.c
1745 *
Manuel Pégourié-Gonnard9d703732013-10-25 18:01:50 +02001746 * This module is used by the following key exchanges:
1747 * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
Paul Bakker5690efc2011-05-26 13:16:06 +00001748 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001749 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001750 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001751#define MBEDTLS_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001752
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001753/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001754 * \def MBEDTLS_SHA1_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001755 *
1756 * Enable the SHA1 cryptographic hash algorithm.
1757 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001758 * Module: library/sha1.c
1759 * Caller: library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001760 * library/ssl_cli.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001761 * library/ssl_srv.c
1762 * library/ssl_tls.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001763 * library/x509write_crt.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001764 *
Gilles Peskine5e79cb32017-05-04 16:17:21 +02001765 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
1766 * depending on the handshake parameters, and for SHA1-signed certificates.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01001767 *
1768 * \warning SHA-1 is considered a weak message digest and its use constitutes
1769 * a security risk. If possible, we recommend avoiding dependencies
1770 * on it, and considering stronger message digests instead.
1771 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001772 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001773#define MBEDTLS_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001774
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001775/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001776 * \def MBEDTLS_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001777 *
1778 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
1779 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001780 * Module: library/sha256.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001781 * Caller: library/entropy.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001782 * library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001783 * library/ssl_cli.c
1784 * library/ssl_srv.c
1785 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001786 *
1787 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001788 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001789 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001790#define MBEDTLS_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001791
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001792/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001793 * \def MBEDTLS_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001794 *
1795 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
1796 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001797 * Module: library/sha512.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001798 * Caller: library/entropy.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001799 * library/md.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001800 * library/ssl_cli.c
1801 * library/ssl_srv.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001802 *
1803 * This module adds support for SHA-384 and SHA-512.
1804 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001805#define MBEDTLS_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001806
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001807/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001808 * \def MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +02001809 *
1810 * Enable the threading abstraction layer.
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +00001811 * By default mbed TLS assumes it is used in a non-threaded environment or that
Paul Bakker2466d932013-09-28 14:40:38 +02001812 * contexts are not shared between threads. If you do intend to use contexts
1813 * between threads, you will need to enable this layer to prevent race
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00001814 * conditions. See also our Knowledge Base article about threading:
1815 * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
Paul Bakker2466d932013-09-28 14:40:38 +02001816 *
1817 * Module: library/threading.c
1818 *
1819 * This allows different threading implementations (self-implemented or
1820 * provided).
1821 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001822 * You will have to enable either MBEDTLS_THREADING_ALT or
1823 * MBEDTLS_THREADING_PTHREAD.
Paul Bakker2466d932013-09-28 14:40:38 +02001824 *
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +00001825 * Enable this layer to allow use of mutexes within mbed TLS
Paul Bakker2466d932013-09-28 14:40:38 +02001826 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001827//#define MBEDTLS_THREADING_C
Paul Bakker2466d932013-09-28 14:40:38 +02001828
1829/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001830 * \def MBEDTLS_VERSION_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001831 *
1832 * Enable run-time version information.
1833 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001834 * Module: library/version.c
1835 *
1836 * This module provides run-time version information.
1837 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001838#define MBEDTLS_VERSION_C
Paul Bakker0a62cd12011-01-21 11:00:08 +00001839
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001840/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001841 * \def MBEDTLS_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001842 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001843 * Enable the XTEA block cipher.
1844 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001845 * Module: library/xtea.c
1846 * Caller:
1847 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001848#define MBEDTLS_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001849
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +00001850/* \} name SECTION: mbed TLS modules */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001851
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001852/**
1853 * \name SECTION: Module configuration options
1854 *
1855 * This section allows for the setting of module specific sizes and
1856 * configuration options. The default values are already present in the
1857 * relevant header files and should suffice for the regular use cases.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001858 *
Paul Bakker088c5c52014-04-25 11:11:10 +02001859 * Our advice is to enable options and change their values here
1860 * only if you have a good reason and know the consequences.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001861 *
1862 * Please check the respective header file for documentation on these
1863 * parameters (to prevent duplicate documentation).
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001864 * \{
1865 */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001866
Paul Bakker088c5c52014-04-25 11:11:10 +02001867/* MPI / BIGNUM options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001868//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1869//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001870
Paul Bakker088c5c52014-04-25 11:11:10 +02001871/* CTR_DRBG options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001872//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
1873//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1874//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1875//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1876//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001877
Paul Bakker088c5c52014-04-25 11:11:10 +02001878/* HMAC_DRBG options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001879//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1880//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1881//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1882//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001883
Paul Bakker088c5c52014-04-25 11:11:10 +02001884/* ECP options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001885//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
1886//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
1887//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
Manuel Pégourié-Gonnard0520b602014-01-30 19:43:46 +01001888
Paul Bakker088c5c52014-04-25 11:11:10 +02001889/* Entropy options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001890//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1891//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
Andres AG7abc9742016-09-23 17:58:49 +01001892//#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 +01001893
Paul Bakker088c5c52014-04-25 11:11:10 +02001894/* Memory buffer allocator options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001895//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001896
Paul Bakker088c5c52014-04-25 11:11:10 +02001897/* Platform options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001898//#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 +02001899//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001900//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
1901//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
Andres Amaya Garcia1e4ec662016-07-20 10:16:25 +01001902//#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 +02001903//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
1904//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001905/* Note: your snprintf must correclty zero-terminate the buffer! */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001906//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
Janos Follath91947442016-03-18 13:49:27 +00001907//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
1908//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
Paul Bakkercf0a9f92016-06-01 11:25:44 +01001909//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1910//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
1911//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
Paul Bakker6e339b52013-07-03 13:37:05 +02001912
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001913/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
1914/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +02001915//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001916//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
1917//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
Andres Amaya Garcia1e4ec662016-07-20 10:16:25 +01001918//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
1919//#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 +02001920//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
1921//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +02001922/* Note: your snprintf must correclty zero-terminate the buffer! */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001923//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
Paul Bakkercf0a9f92016-06-01 11:25:44 +01001924//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
1925//#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 +02001926
Paul Bakker088c5c52014-04-25 11:11:10 +02001927/* SSL Cache options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001928//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1929//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001930
Paul Bakker088c5c52014-04-25 11:11:10 +02001931/* SSL options */
Angus Grattond8213d02016-05-25 20:56:48 +10001932
1933/** \def MBEDTLS_SSL_MAX_CONTENT_LEN
1934 *
1935 * Maximum fragment length in bytes.
1936 *
1937 * Determines the size of both the incoming and outgoing TLS I/O buffers.
1938 *
1939 * Uncommenting MBEDTLS_SSL_IN_CONTENT_LEN and/or MBEDTLS_SSL_OUT_CONTENT_LEN
1940 * will override this length by setting maximum incoming and/or outgoing
1941 * fragment length, respectively.
1942 */
1943//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384
1944
1945/** \def MBEDTLS_SSL_IN_CONTENT_LEN
1946 *
1947 * Maximum incoming fragment length in bytes.
1948 *
1949 * Uncomment to set the size of the inward TLS buffer independently of the
1950 * outward buffer.
1951 */
1952//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
1953
1954/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
1955 *
1956 * Maximum outgoing fragment length in bytes.
1957 *
1958 * Uncomment to set the size of the outward TLS buffer independently of the
1959 * inward buffer.
1960 *
1961 * It is possible to save RAM by setting a smaller outward buffer, while keeping
1962 * the default inward 16384 byte buffer to conform to the TLS specification.
1963 *
1964 * The minimum required outward buffer size is determined by the handshake
1965 * protocol's usage. Handshaking will fail if the outward buffer is too small.
1966 * The specific size requirement depends on the configured ciphers and any
1967 * certificate data which is sent during the handshake.
1968 *
1969 * For absolute minimum RAM usage, it's best to enable
1970 * MBEDTLS_SSL_MAX_FRAGMENT_LENGTH and reduce MBEDTLS_SSL_MAX_CONTENT_LEN. This
1971 * reduces both incoming and outgoing buffer sizes. However this is only
1972 * guaranteed if the other end of the connection also supports the TLS
1973 * max_fragment_len extension. Otherwise the connection may fail.
1974 */
1975//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
1976
Hanno Beckere0b150f2018-08-21 15:51:03 +01001977/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
1978 *
1979 * Maximum number of heap-allocated bytes for the purpose of
1980 * DTLS handshake message reassembly and future message buffering.
1981 *
Hanno Becker97a1c132018-08-28 14:42:15 +01001982 * This should be at least 9/8 * MBEDTLSSL_IN_CONTENT_LEN
Hanno Becker28007512018-08-28 09:46:44 +01001983 * to account for a reassembled handshake message of maximum size,
1984 * together with its reassembly bitmap.
1985 *
Hanno Becker97a1c132018-08-28 14:42:15 +01001986 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
Hanno Becker28007512018-08-28 09:46:44 +01001987 * should be sufficient for all practical situations as it allows
1988 * to reassembly a large handshake message (such as a certificate)
1989 * while buffering multiple smaller handshake messages.
1990 *
Hanno Beckere0b150f2018-08-21 15:51:03 +01001991 */
Hanno Becker159a37f2018-08-24 15:07:29 +01001992//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
Hanno Beckere0b150f2018-08-21 15:51:03 +01001993
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001994//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
1995//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
1996//#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 +02001997
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001998/**
1999 * Complete list of ciphersuites to use, in order of preference.
2000 *
2001 * \warning No dependency checking is done on that field! This option can only
2002 * be used to restrict the set of available ciphersuites. It is your
2003 * responsibility to make sure the needed modules are active.
2004 *
2005 * Use this to save a few hundred bytes of ROM (default ordering of all
2006 * available ciphersuites) and a few to a few hundred bytes of RAM.
2007 *
2008 * The value below is only an example, not the default.
2009 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002010//#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 +02002011
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01002012/* X509 options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002013//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
Andres AGf9113192016-09-02 14:06:04 +01002014//#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 +01002015
Gilles Peskine5e79cb32017-05-04 16:17:21 +02002016/**
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002017 * Allow SHA-1 in the default TLS configuration for certificate signing.
2018 * Without this build-time option, SHA-1 support must be activated explicitly
2019 * through mbedtls_ssl_conf_cert_profile. Turning on this option is not
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002020 * recommended because of it is possible to generate SHA-1 collisions, however
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002021 * this may be safe for legacy infrastructure where additional controls apply.
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002022 *
2023 * \warning SHA-1 is considered a weak message digest and its use constitutes
2024 * a security risk. If possible, we recommend avoiding dependencies
2025 * on it, and considering stronger message digests instead.
2026 *
Gilles Peskine5e79cb32017-05-04 16:17:21 +02002027 */
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002028// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
2029
2030/**
2031 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
2032 * signature and ciphersuite selection. Without this build-time option, SHA-1
2033 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
2034 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
2035 * default. At the time of writing, there is no practical attack on the use
2036 * of SHA-1 in handshake signatures, hence this option is turned on by default
Hanno Beckerbbca8c52017-09-25 14:53:51 +01002037 * to preserve compatibility with existing peers, but the general
2038 * warning applies nonetheless:
2039 *
2040 * \warning SHA-1 is considered a weak message digest and its use constitutes
2041 * a security risk. If possible, we recommend avoiding dependencies
2042 * on it, and considering stronger message digests instead.
2043 *
Gilles Peskine5d2511c2017-05-12 13:16:40 +02002044 */
2045#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
Gilles Peskine5e79cb32017-05-04 16:17:21 +02002046
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002047/**
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002048 * Uncomment the macro to let mbed TLS use your alternate implementation of
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002049 * mbedtls_platform_zeroize(). This replaces the default implementation in
2050 * platform_util.c.
Andres Amaya Garcia6606d5c2018-03-08 20:25:29 +00002051 *
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002052 * mbedtls_platform_zeroize() is a widely used function across the library to
2053 * zero a block of memory. The implementation is expected to be secure in the
2054 * sense that it has been written to prevent the compiler from removing calls
2055 * to mbedtls_platform_zeroize() as part of redundant code elimination
2056 * optimizations. However, it is difficult to guarantee that calls to
2057 * mbedtls_platform_zeroize() will not be optimized by the compiler as older
2058 * versions of the C language standards do not provide a secure implementation
2059 * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to
2060 * configure their own implementation of mbedtls_platform_zeroize(), for
Andres Amaya Garciad0ef4682018-04-24 08:31:34 -05002061 * example by using directives specific to their compiler, features from newer
2062 * C standards (e.g using memset_s() in C11) or calling a secure memset() from
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002063 * their system (e.g explicit_bzero() in BSD).
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002064 */
Andres Amaya Garciac58787f2018-04-17 10:21:45 -05002065//#define MBEDTLS_PLATFORM_ZEROIZE_ALT
Andres Amaya Garciab1262a32017-10-25 09:51:14 +01002066
Simon Butcher30b5f972016-06-08 19:00:23 +01002067/* \} name SECTION: Customisation configuration options */
Manuel Pégourié-Gonnard43569a92015-07-31 15:37:29 +02002068
Simon Butcherb2c81b12016-06-23 13:56:06 +01002069/* Target and application specific configurations */
Ron Eldor6fd941f2017-05-14 16:17:33 +03002070//#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "target_config.h"
Simon Butcher1d46a2d2016-07-11 10:17:03 +01002071
2072#if defined(TARGET_LIKE_MBED) && defined(YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE)
2073#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
2074#endif
Simon Butcherb2c81b12016-06-23 13:56:06 +01002075
Manuel Pégourié-Gonnard32da9f62015-07-31 15:52:30 +02002076/*
2077 * Allow user to override any previous default.
2078 *
2079 * Use two macro names for that, as:
2080 * - with yotta the prefix YOTTA_CFG_ is forced
2081 * - without yotta is looks weird to have a YOTTA prefix.
2082 */
2083#if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
2084#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
2085#elif defined(MBEDTLS_USER_CONFIG_FILE)
2086#include MBEDTLS_USER_CONFIG_FILE
2087#endif
2088
Gilles Peskine66920ce2018-03-03 21:49:49 +01002089#include "mbedtls/check_config.h"
Manuel Pégourié-Gonnard92ac76f2013-12-16 17:12:53 +01002090
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02002091#endif /* MBEDTLS_CONFIG_H */