1 /** 2 * \file config.h 3 * 4 * \brief Configuration options (set of defines) 5 * 6 * This set of compile-time options may be used to enable 7 * or disable features selectively, and reduce the global 8 * memory footprint. 9 * 10 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 11 * SPDX-License-Identifier: Apache-2.0 12 * 13 * Licensed under the Apache License, Version 2.0 (the "License"); you may 14 * not use this file except in compliance with the License. 15 * You may obtain a copy of the License at 16 * 17 * http://www.apache.org/licenses/LICENSE-2.0 18 * 19 * Unless required by applicable law or agreed to in writing, software 20 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 21 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 * See the License for the specific language governing permissions and 23 * limitations under the License. 24 * 25 * This file is part of mbed TLS (https://tls.mbed.org) 26 */ 27 28 #ifndef MBEDTLS_CONFIG_H 29 #define MBEDTLS_CONFIG_H 30 31 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 32 #define _CRT_SECURE_NO_DEPRECATE 1 33 #endif 34 35 /** 36 * \name SECTION: System support 37 * 38 * This section sets system specific settings. 39 * \{ 40 */ 41 42 /** 43 * \def MBEDTLS_HAVE_ASM 44 * 45 * The compiler has support for asm(). 46 * 47 * Requires support for asm() in compiler. 48 * 49 * Used in: 50 * library/timing.c 51 * library/padlock.c 52 * include/mbedtls/bn_mul.h 53 * 54 * Comment to disable the use of assembly code. 55 */ 56 #define MBEDTLS_HAVE_ASM 57 58 /** 59 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED 60 * 61 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve 62 * module. By default all supported curves are enabled. 63 * 64 * Comment macros to disable the curve and functions for it 65 */ 66 #define MBEDTLS_ECP_DP_SECP192R1_ENABLED 67 #define MBEDTLS_ECP_DP_SECP224R1_ENABLED 68 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED 69 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED 70 #define MBEDTLS_ECP_DP_SECP521R1_ENABLED 71 #define MBEDTLS_ECP_DP_SECP192K1_ENABLED 72 #define MBEDTLS_ECP_DP_SECP224K1_ENABLED 73 #define MBEDTLS_ECP_DP_SECP256K1_ENABLED 74 75 /** 76 * \def MBEDTLS_ECDSA_DETERMINISTIC 77 * 78 * Enable deterministic ECDSA (RFC 6979). 79 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing 80 * may result in a compromise of the long-term signing key. This is avoided by 81 * the deterministic variant. 82 * 83 * Requires: MBEDTLS_HMAC_DRBG_C 84 * 85 * Comment this macro to disable deterministic ECDSA. 86 */ 87 //#define MBEDTLS_ECDSA_DETERMINISTIC 88 89 /** 90 * \def MBEDTLS_GENPRIME 91 * 92 * Enable the prime-number generation code. 93 * 94 * Requires: MBEDTLS_BIGNUM_C 95 */ 96 #define MBEDTLS_GENPRIME 97 98 /** 99 * \def MBEDTLS_ZLIB_SUPPORT 100 * 101 * If set, the SSL/TLS module uses ZLIB to support compression and 102 * decompression of packet data. 103 * 104 * \warning TLS-level compression MAY REDUCE SECURITY! See for example the 105 * CRIME attack. Before enabling this option, you should examine with care if 106 * CRIME or similar exploits may be a applicable to your use case. 107 * 108 * \note Currently compression can't be used with DTLS. 109 * 110 * Used in: library/ssl_tls.c 111 * library/ssl_cli.c 112 * library/ssl_srv.c 113 * 114 * This feature requires zlib library and headers to be present. 115 * 116 * Uncomment to enable use of ZLIB 117 */ 118 //#define MBEDTLS_ZLIB_SUPPORT 119 /* \} name SECTION: mbed TLS feature support */ 120 121 /** 122 * \name SECTION: mbed TLS modules 123 * 124 * This section enables or disables entire modules in mbed TLS 125 * \{ 126 */ 127 128 /** 129 * \def MBEDTLS_AESNI_C 130 * 131 * Enable AES-NI support on x86-64. 132 * 133 * Module: library/aesni.c 134 * Caller: library/aes.c 135 * 136 * Requires: MBEDTLS_HAVE_ASM 137 * 138 * This modules adds support for the AES-NI instructions on x86-64 139 */ 140 #define MBEDTLS_AESNI_C 141 142 /** 143 * \def MBEDTLS_ASN1_PARSE_C 144 * 145 * Enable the generic ASN1 parser. 146 * 147 * Module: library/asn1.c 148 * Caller: library/x509.c 149 * library/dhm.c 150 * library/pkcs12.c 151 * library/pkcs5.c 152 * library/pkparse.c 153 */ 154 #define MBEDTLS_ASN1_PARSE_C 155 156 /** 157 * \def MBEDTLS_ASN1_WRITE_C 158 * 159 * Enable the generic ASN1 writer. 160 * 161 * Module: library/asn1write.c 162 * Caller: library/ecdsa.c 163 * library/pkwrite.c 164 * library/x509_create.c 165 * library/x509write_crt.c 166 * library/x509write_csr.c 167 */ 168 #define MBEDTLS_ASN1_WRITE_C 169 170 /** 171 * \def MBEDTLS_BASE64_C 172 * 173 * Enable the Base64 module. 174 * 175 * Module: library/base64.c 176 * Caller: library/pem.c 177 * 178 * This module is required for PEM support (required by X.509). 179 */ 180 #define MBEDTLS_BASE64_C 181 182 /** 183 * \def MBEDTLS_BIGNUM_C 184 * 185 * Enable the multi-precision integer library. 186 * 187 * Module: library/bignum.c 188 * Caller: library/dhm.c 189 * library/ecp.c 190 * library/ecdsa.c 191 * library/rsa.c 192 * library/ssl_tls.c 193 * 194 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. 195 */ 196 #define MBEDTLS_BIGNUM_C 197 198 /** 199 * \def MBEDTLS_ECDH_C 200 * 201 * Enable the elliptic curve Diffie-Hellman library. 202 * 203 * Module: library/ecdh.c 204 * Caller: library/ssl_cli.c 205 * library/ssl_srv.c 206 * 207 * This module is used by the following key exchanges: 208 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK 209 * 210 * Requires: MBEDTLS_ECP_C 211 */ 212 #define MBEDTLS_ECDH_C 213 214 /** 215 * \def MBEDTLS_ECDSA_C 216 * 217 * Enable the elliptic curve DSA library. 218 * 219 * Module: library/ecdsa.c 220 * Caller: 221 * 222 * This module is used by the following key exchanges: 223 * ECDHE-ECDSA 224 * 225 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C 226 */ 227 #define MBEDTLS_ECDSA_C 228 229 /** 230 * \def MBEDTLS_ECJPAKE_C 231 * 232 * Enable the elliptic curve J-PAKE library. 233 * 234 * \warning This is currently experimental. EC J-PAKE support is based on the 235 * Thread v1.0.0 specification; incompatible changes to the specification 236 * might still happen. For this reason, this is disabled by default. 237 * 238 * Module: library/ecjpake.c 239 * Caller: 240 * 241 * This module is used by the following key exchanges: 242 * ECJPAKE 243 * 244 * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C 245 */ 246 //#define MBEDTLS_ECJPAKE_C 247 248 /** 249 * \def MBEDTLS_ECP_C 250 * 251 * Enable the elliptic curve over GF(p) library. 252 * 253 * Module: library/ecp.c 254 * Caller: library/ecdh.c 255 * library/ecdsa.c 256 * library/ecjpake.c 257 * 258 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED 259 */ 260 #define MBEDTLS_ECP_C 261 262 /** 263 * \def MBEDTLS_ERROR_C 264 * 265 * Enable error code to error string conversion. 266 * 267 * Module: library/error.c 268 * Caller: 269 * 270 * This module enables mbedtls_strerror(). 271 */ 272 #define MBEDTLS_ERROR_C 273 274 275 #endif /* MBEDTLS_CONFIG_H */ 276