1 /** 2 * \file config-hitool.h 3 * 4 * \brief SecureTool mbedtls库的配置文件,基于3.1.0版本的include\mbedtls\mbedtls_config.h配置文件。 5 * 6 * 产品在使用时,在编译前,将此文件强制覆盖默认的配置文件即可,使用方式如下: 7 * cp -f ./configs/vendor/config-hitool.h ./include/mbedtls/mbedtls_config.h 8 */ 9 10 #define MBEDTLS_ALLOW_PRIVATE_ACCESS 11 12 /** 13 * This is an optional version symbol that enables compatibility handling of 14 * config files. 15 * 16 * It is equal to the #MBEDTLS_VERSION_NUMBER of the Mbed TLS version that 17 * introduced the config format we want to be compatible with. 18 */ 19 //#define MBEDTLS_CONFIG_VERSION 0x03000000 20 21 /** 22 * \name SECTION: System support 23 * 24 * This section sets system specific settings. 25 * \{ 26 */ 27 28 /** 29 * \def MBEDTLS_HAVE_ASM 30 * 31 * The compiler has support for asm(). 32 * 33 * Requires support for asm() in compiler. 34 * 35 * Used in: 36 * library/aria.c 37 * library/bn_mul.h 38 * 39 * Required by: 40 * MBEDTLS_AESNI_C 41 * MBEDTLS_PADLOCK_C 42 * 43 * Comment to disable the use of assembly code. 44 */ 45 #define MBEDTLS_HAVE_ASM 46 47 /** 48 * \def MBEDTLS_NO_UDBL_DIVISION 49 * 50 * The platform lacks support for double-width integer division (64-bit 51 * division on a 32-bit platform, 128-bit division on a 64-bit platform). 52 * 53 * Used in: 54 * include/mbedtls/bignum.h 55 * library/bignum.c 56 * 57 * The bignum code uses double-width division to speed up some operations. 58 * Double-width division is often implemented in software that needs to 59 * be linked with the program. The presence of a double-width integer 60 * type is usually detected automatically through preprocessor macros, 61 * but the automatic detection cannot know whether the code needs to 62 * and can be linked with an implementation of division for that type. 63 * By default division is assumed to be usable if the type is present. 64 * Uncomment this option to prevent the use of double-width division. 65 * 66 * Note that division for the native integer type is always required. 67 * Furthermore, a 64-bit type is always required even on a 32-bit 68 * platform, but it need not support multiplication or division. In some 69 * cases it is also desirable to disable some double-width operations. For 70 * example, if double-width division is implemented in software, disabling 71 * it can reduce code size in some embedded targets. 72 */ 73 //#define MBEDTLS_NO_UDBL_DIVISION 74 75 /** 76 * \def MBEDTLS_NO_64BIT_MULTIPLICATION 77 * 78 * The platform lacks support for 32x32 -> 64-bit multiplication. 79 * 80 * Used in: 81 * library/poly1305.c 82 * 83 * Some parts of the library may use multiplication of two unsigned 32-bit 84 * operands with a 64-bit result in order to speed up computations. On some 85 * platforms, this is not available in hardware and has to be implemented in 86 * software, usually in a library provided by the toolchain. 87 * 88 * Sometimes it is not desirable to have to link to that library. This option 89 * removes the dependency of that library on platforms that lack a hardware 90 * 64-bit multiplier by embedding a software implementation in Mbed TLS. 91 * 92 * Note that depending on the compiler, this may decrease performance compared 93 * to using the library function provided by the toolchain. 94 */ 95 //#define MBEDTLS_NO_64BIT_MULTIPLICATION 96 97 /** 98 * \def MBEDTLS_HAVE_SSE2 99 * 100 * CPU supports SSE2 instruction set. 101 * 102 * Uncomment if the CPU supports SSE2 (IA-32 specific). 103 */ 104 //#define MBEDTLS_HAVE_SSE2 105 106 /** 107 * \def MBEDTLS_HAVE_TIME 108 * 109 * System has time.h and time(). 110 * The time does not need to be correct, only time differences are used, 111 * by contrast with MBEDTLS_HAVE_TIME_DATE 112 * 113 * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, 114 * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and 115 * MBEDTLS_PLATFORM_STD_TIME. 116 * 117 * Comment if your system does not support time functions. 118 * 119 * \note If MBEDTLS_TIMING_C is set - to enable the semi-portable timing 120 * interface - timing.c will include time.h on suitable platforms 121 * regardless of the setting of MBEDTLS_HAVE_TIME, unless 122 * MBEDTLS_TIMING_ALT is used. See timing.c for more information. 123 */ 124 #define MBEDTLS_HAVE_TIME 125 126 /** 127 * \def MBEDTLS_HAVE_TIME_DATE 128 * 129 * System has time.h, time(), and an implementation for 130 * mbedtls_platform_gmtime_r() (see below). 131 * The time needs to be correct (not necessarily very accurate, but at least 132 * the date should be correct). This is used to verify the validity period of 133 * X.509 certificates. 134 * 135 * Comment if your system does not have a correct clock. 136 * 137 * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that 138 * behaves similarly to the gmtime_r() function from the C standard. Refer to 139 * the documentation for mbedtls_platform_gmtime_r() for more information. 140 * 141 * \note It is possible to configure an implementation for 142 * mbedtls_platform_gmtime_r() at compile-time by using the macro 143 * MBEDTLS_PLATFORM_GMTIME_R_ALT. 144 */ 145 #define MBEDTLS_HAVE_TIME_DATE 146 147 /** 148 * \def MBEDTLS_PLATFORM_MEMORY 149 * 150 * Enable the memory allocation layer. 151 * 152 * By default mbed TLS uses the system-provided calloc() and free(). 153 * This allows different allocators (self-implemented or provided) to be 154 * provided to the platform abstraction layer. 155 * 156 * Enabling MBEDTLS_PLATFORM_MEMORY without the 157 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide 158 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and 159 * free() function pointer at runtime. 160 * 161 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying 162 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the 163 * alternate function at compile time. 164 * 165 * Requires: MBEDTLS_PLATFORM_C 166 * 167 * Enable this layer to allow use of alternative memory allocators. 168 */ 169 //#define MBEDTLS_PLATFORM_MEMORY 170 171 /** 172 * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS 173 * 174 * Do not assign standard functions in the platform layer (e.g. calloc() to 175 * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) 176 * 177 * This makes sure there are no linking errors on platforms that do not support 178 * these functions. You will HAVE to provide alternatives, either at runtime 179 * via the platform_set_xxx() functions or at compile time by setting 180 * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a 181 * MBEDTLS_PLATFORM_XXX_MACRO. 182 * 183 * Requires: MBEDTLS_PLATFORM_C 184 * 185 * Uncomment to prevent default assignment of standard functions in the 186 * platform layer. 187 */ 188 //#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS 189 190 /** 191 * \def MBEDTLS_PLATFORM_EXIT_ALT 192 * 193 * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the 194 * function in the platform abstraction layer. 195 * 196 * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will 197 * provide a function "mbedtls_platform_set_printf()" that allows you to set an 198 * alternative printf function pointer. 199 * 200 * All these define require MBEDTLS_PLATFORM_C to be defined! 201 * 202 * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; 203 * it will be enabled automatically by check_config.h 204 * 205 * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as 206 * MBEDTLS_PLATFORM_XXX_MACRO! 207 * 208 * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME 209 * 210 * Uncomment a macro to enable alternate implementation of specific base 211 * platform function 212 */ 213 //#define MBEDTLS_PLATFORM_SETBUF_ALT 214 //#define MBEDTLS_PLATFORM_EXIT_ALT 215 //#define MBEDTLS_PLATFORM_TIME_ALT 216 //#define MBEDTLS_PLATFORM_FPRINTF_ALT 217 //#define MBEDTLS_PLATFORM_PRINTF_ALT 218 //#define MBEDTLS_PLATFORM_SNPRINTF_ALT 219 //#define MBEDTLS_PLATFORM_VSNPRINTF_ALT 220 //#define MBEDTLS_PLATFORM_NV_SEED_ALT 221 //#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT 222 223 /** 224 * \def MBEDTLS_DEPRECATED_WARNING 225 * 226 * Mark deprecated functions and features so that they generate a warning if 227 * used. Functionality deprecated in one version will usually be removed in the 228 * next version. You can enable this to help you prepare the transition to a 229 * new major version by making sure your code is not using this functionality. 230 * 231 * This only works with GCC and Clang. With other compilers, you may want to 232 * use MBEDTLS_DEPRECATED_REMOVED 233 * 234 * Uncomment to get warnings on using deprecated functions and features. 235 */ 236 //#define MBEDTLS_DEPRECATED_WARNING 237 238 /** 239 * \def MBEDTLS_DEPRECATED_REMOVED 240 * 241 * Remove deprecated functions and features so that they generate an error if 242 * used. Functionality deprecated in one version will usually be removed in the 243 * next version. You can enable this to help you prepare the transition to a 244 * new major version by making sure your code is not using this functionality. 245 * 246 * Uncomment to get errors on using deprecated functions and features. 247 */ 248 //#define MBEDTLS_DEPRECATED_REMOVED 249 250 /** \} name SECTION: System support */ 251 252 /** 253 * \name SECTION: mbed TLS feature support 254 * 255 * This section sets support for features that are or are not needed 256 * within the modules that are enabled. 257 * \{ 258 */ 259 260 /** 261 * \def MBEDTLS_TIMING_ALT 262 * 263 * Uncomment to provide your own alternate implementation for 264 * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay() 265 * 266 * Only works if you have MBEDTLS_TIMING_C enabled. 267 * 268 * You will need to provide a header "timing_alt.h" and an implementation at 269 * compile time. 270 */ 271 //#define MBEDTLS_TIMING_ALT 272 273 /** 274 * \def MBEDTLS_AES_ALT 275 * 276 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your 277 * alternate core implementation of a symmetric crypto, an arithmetic or hash 278 * module (e.g. platform specific assembly optimized implementations). Keep 279 * in mind that the function prototypes should remain the same. 280 * 281 * This replaces the whole module. If you only want to replace one of the 282 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. 283 * 284 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer 285 * provide the "struct mbedtls_aes_context" definition and omit the base 286 * function declarations and implementations. "aes_alt.h" will be included from 287 * "aes.h" to include the new function definitions. 288 * 289 * Uncomment a macro to enable alternate implementation of the corresponding 290 * module. 291 * 292 * \warning MD5, DES and SHA-1 are considered weak and their 293 * use constitutes a security risk. If possible, we recommend 294 * avoiding dependencies on them, and considering stronger message 295 * digests and ciphers instead. 296 * 297 */ 298 //#define MBEDTLS_AES_ALT 299 //#define MBEDTLS_ARIA_ALT 300 //#define MBEDTLS_CAMELLIA_ALT 301 //#define MBEDTLS_CCM_ALT 302 //#define MBEDTLS_CHACHA20_ALT 303 //#define MBEDTLS_CHACHAPOLY_ALT 304 //#define MBEDTLS_CMAC_ALT 305 //#define MBEDTLS_DES_ALT 306 //#define MBEDTLS_DHM_ALT 307 //#define MBEDTLS_ECJPAKE_ALT 308 //#define MBEDTLS_GCM_ALT 309 //#define MBEDTLS_NIST_KW_ALT 310 //#define MBEDTLS_MD5_ALT 311 //#define MBEDTLS_POLY1305_ALT 312 //#define MBEDTLS_RIPEMD160_ALT 313 //#define MBEDTLS_RSA_ALT 314 //#define MBEDTLS_SHA1_ALT 315 //#define MBEDTLS_SHA256_ALT 316 //#define MBEDTLS_SHA512_ALT 317 318 /* 319 * When replacing the elliptic curve module, please consider, that it is 320 * implemented with two .c files: 321 * - ecp.c 322 * - ecp_curves.c 323 * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT 324 * macros as described above. The only difference is that you have to make sure 325 * that you provide functionality for both .c files. 326 */ 327 //#define MBEDTLS_ECP_ALT 328 329 /** 330 * \def MBEDTLS_SHA256_PROCESS_ALT 331 * 332 * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you 333 * alternate core implementation of symmetric crypto or hash function. Keep in 334 * mind that function prototypes should remain the same. 335 * 336 * This replaces only one function. The header file from mbed TLS is still 337 * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. 338 * 339 * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will 340 * no longer provide the mbedtls_sha1_process() function, but it will still provide 341 * the other function (using your mbedtls_sha1_process() function) and the definition 342 * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible 343 * with this definition. 344 * 345 * \note If you use the AES_xxx_ALT macros, then it is recommended to also set 346 * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES 347 * tables. 348 * 349 * Uncomment a macro to enable alternate implementation of the corresponding 350 * function. 351 * 352 * \warning MD5, DES and SHA-1 are considered weak and their use 353 * constitutes a security risk. If possible, we recommend avoiding 354 * dependencies on them, and considering stronger message digests 355 * and ciphers instead. 356 * 357 * \warning If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC are 358 * enabled, then the deterministic ECDH signature functions pass the 359 * the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). Therefore 360 * alternative implementations should use the RNG only for generating 361 * the ephemeral key and nothing else. If this is not possible, then 362 * MBEDTLS_ECDSA_DETERMINISTIC should be disabled and an alternative 363 * implementation should be provided for mbedtls_ecdsa_sign_det_ext(). 364 * 365 */ 366 //#define MBEDTLS_MD5_PROCESS_ALT 367 //#define MBEDTLS_RIPEMD160_PROCESS_ALT 368 //#define MBEDTLS_SHA1_PROCESS_ALT 369 //#define MBEDTLS_SHA256_PROCESS_ALT 370 //#define MBEDTLS_SHA512_PROCESS_ALT 371 //#define MBEDTLS_DES_SETKEY_ALT 372 //#define MBEDTLS_DES_CRYPT_ECB_ALT 373 //#define MBEDTLS_DES3_CRYPT_ECB_ALT 374 //#define MBEDTLS_AES_SETKEY_ENC_ALT 375 //#define MBEDTLS_AES_SETKEY_DEC_ALT 376 //#define MBEDTLS_AES_ENCRYPT_ALT 377 //#define MBEDTLS_AES_DECRYPT_ALT 378 //#define MBEDTLS_ECDH_GEN_PUBLIC_ALT 379 //#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT 380 //#define MBEDTLS_ECDSA_VERIFY_ALT 381 //#define MBEDTLS_ECDSA_SIGN_ALT 382 //#define MBEDTLS_ECDSA_GENKEY_ALT 383 384 /** 385 * \def MBEDTLS_ECP_INTERNAL_ALT 386 * 387 * Expose a part of the internal interface of the Elliptic Curve Point module. 388 * 389 * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your 390 * alternative core implementation of elliptic curve arithmetic. Keep in mind 391 * that function prototypes should remain the same. 392 * 393 * This partially replaces one function. The header file from mbed TLS is still 394 * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation 395 * is still present and it is used for group structures not supported by the 396 * alternative. 397 * 398 * The original implementation can in addition be removed by setting the 399 * MBEDTLS_ECP_NO_FALLBACK option, in which case any function for which the 400 * corresponding MBEDTLS_ECP__FUNCTION_NAME__ALT macro is defined will not be 401 * able to fallback to curves not supported by the alternative implementation. 402 * 403 * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT 404 * and implementing the following functions: 405 * unsigned char mbedtls_internal_ecp_grp_capable( 406 * const mbedtls_ecp_group *grp ) 407 * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ) 408 * void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp ) 409 * The mbedtls_internal_ecp_grp_capable function should return 1 if the 410 * replacement functions implement arithmetic for the given group and 0 411 * otherwise. 412 * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_free are 413 * called before and after each point operation and provide an opportunity to 414 * implement optimized set up and tear down instructions. 415 * 416 * Example: In case you set MBEDTLS_ECP_INTERNAL_ALT and 417 * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac() 418 * function, but will use your mbedtls_internal_ecp_double_jac() if the group 419 * for the operation is supported by your implementation (i.e. your 420 * mbedtls_internal_ecp_grp_capable() function returns 1 for this group). If the 421 * group is not supported by your implementation, then the original mbed TLS 422 * implementation of ecp_double_jac() is used instead, unless this fallback 423 * behaviour is disabled by setting MBEDTLS_ECP_NO_FALLBACK (in which case 424 * ecp_double_jac() will return MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE). 425 * 426 * The function prototypes and the definition of mbedtls_ecp_group and 427 * mbedtls_ecp_point will not change based on MBEDTLS_ECP_INTERNAL_ALT, so your 428 * implementation of mbedtls_internal_ecp__function_name__ must be compatible 429 * with their definitions. 430 * 431 * Uncomment a macro to enable alternate implementation of the corresponding 432 * function. 433 */ 434 /* Required for all the functions in this section */ 435 //#define MBEDTLS_ECP_INTERNAL_ALT 436 /* Turn off software fallback for curves not supported in hardware */ 437 //#define MBEDTLS_ECP_NO_FALLBACK 438 /* Support for Weierstrass curves with Jacobi representation */ 439 //#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT 440 //#define MBEDTLS_ECP_ADD_MIXED_ALT 441 //#define MBEDTLS_ECP_DOUBLE_JAC_ALT 442 //#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT 443 //#define MBEDTLS_ECP_NORMALIZE_JAC_ALT 444 /* Support for curves with Montgomery arithmetic */ 445 //#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT 446 //#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT 447 //#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT 448 449 /** 450 * \def MBEDTLS_ENTROPY_HARDWARE_ALT 451 * 452 * Uncomment this macro to let mbed TLS use your own implementation of a 453 * hardware entropy collector. 454 * 455 * Your function must be called \c mbedtls_hardware_poll(), have the same 456 * prototype as declared in library/entropy_poll.h, and accept NULL as first 457 * argument. 458 * 459 * Uncomment to use your own hardware entropy collector. 460 */ 461 //#define MBEDTLS_ENTROPY_HARDWARE_ALT 462 463 /** 464 * \def MBEDTLS_AES_ROM_TABLES 465 * 466 * Use precomputed AES tables stored in ROM. 467 * 468 * Uncomment this macro to use precomputed AES tables stored in ROM. 469 * Comment this macro to generate AES tables in RAM at runtime. 470 * 471 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb 472 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the 473 * initialization time before the first AES operation can be performed. 474 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c 475 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded 476 * performance if ROM access is slower than RAM access. 477 * 478 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES. 479 * 480 */ 481 //#define MBEDTLS_AES_ROM_TABLES 482 483 /** 484 * \def MBEDTLS_AES_FEWER_TABLES 485 * 486 * Use less ROM/RAM for AES tables. 487 * 488 * Uncommenting this macro omits 75% of the AES tables from 489 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES) 490 * by computing their values on the fly during operations 491 * (the tables are entry-wise rotations of one another). 492 * 493 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint 494 * by ~6kb but at the cost of more arithmetic operations during 495 * runtime. Specifically, one has to compare 4 accesses within 496 * different tables to 4 accesses with additional arithmetic 497 * operations within the same table. The performance gain/loss 498 * depends on the system and memory details. 499 * 500 * This option is independent of \c MBEDTLS_AES_ROM_TABLES. 501 * 502 */ 503 //#define MBEDTLS_AES_FEWER_TABLES 504 505 /** 506 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY 507 * 508 * Use less ROM for the Camellia implementation (saves about 768 bytes). 509 * 510 * Uncomment this macro to use less memory for Camellia. 511 */ 512 //#define MBEDTLS_CAMELLIA_SMALL_MEMORY 513 514 /** 515 * \def MBEDTLS_CHECK_RETURN_WARNING 516 * 517 * If this macro is defined, emit a compile-time warning if application code 518 * calls a function without checking its return value, but the return value 519 * should generally be checked in portable applications. 520 * 521 * This is only supported on platforms where #MBEDTLS_CHECK_RETURN is 522 * implemented. Otherwise this option has no effect. 523 * 524 * Uncomment to get warnings on using fallible functions without checking 525 * their return value. 526 * 527 * \note This feature is a work in progress. 528 * Warnings will be added to more functions in the future. 529 * 530 * \note A few functions are considered critical, and ignoring the return 531 * value of these functions will trigger a warning even if this 532 * macro is not defined. To completely disable return value check 533 * warnings, define #MBEDTLS_CHECK_RETURN with an empty expansion. 534 */ 535 //#define MBEDTLS_CHECK_RETURN_WARNING 536 537 /** 538 * \def MBEDTLS_CIPHER_MODE_CBC 539 * 540 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers. 541 */ 542 #define MBEDTLS_CIPHER_MODE_CBC 543 544 /** 545 * \def MBEDTLS_CIPHER_MODE_CFB 546 * 547 * Enable Cipher Feedback mode (CFB) for symmetric ciphers. 548 */ 549 #define MBEDTLS_CIPHER_MODE_CFB 550 551 /** 552 * \def MBEDTLS_CIPHER_MODE_CTR 553 * 554 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. 555 */ 556 #define MBEDTLS_CIPHER_MODE_CTR 557 558 /** 559 * \def MBEDTLS_CIPHER_MODE_OFB 560 * 561 * Enable Output Feedback mode (OFB) for symmetric ciphers. 562 */ 563 #define MBEDTLS_CIPHER_MODE_OFB 564 565 /** 566 * \def MBEDTLS_CIPHER_MODE_XTS 567 * 568 * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. 569 */ 570 #define MBEDTLS_CIPHER_MODE_XTS 571 572 /** 573 * \def MBEDTLS_CIPHER_NULL_CIPHER 574 * 575 * Enable NULL cipher. 576 * Warning: Only do so when you know what you are doing. This allows for 577 * encryption or channels without any security! 578 * 579 * To enable the following ciphersuites: 580 * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA 581 * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA 582 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA 583 * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA 584 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 585 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 586 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA 587 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 588 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 589 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA 590 * MBEDTLS_TLS_RSA_WITH_NULL_SHA256 591 * MBEDTLS_TLS_RSA_WITH_NULL_SHA 592 * MBEDTLS_TLS_RSA_WITH_NULL_MD5 593 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 594 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 595 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA 596 * MBEDTLS_TLS_PSK_WITH_NULL_SHA384 597 * MBEDTLS_TLS_PSK_WITH_NULL_SHA256 598 * MBEDTLS_TLS_PSK_WITH_NULL_SHA 599 * 600 * Uncomment this macro to enable the NULL cipher and ciphersuites 601 */ 602 //#define MBEDTLS_CIPHER_NULL_CIPHER 603 604 /** 605 * \def MBEDTLS_CIPHER_PADDING_PKCS7 606 * 607 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for 608 * specific padding modes in the cipher layer with cipher modes that support 609 * padding (e.g. CBC) 610 * 611 * If you disable all padding modes, only full blocks can be used with CBC. 612 * 613 * Enable padding modes in the cipher layer. 614 */ 615 #define MBEDTLS_CIPHER_PADDING_PKCS7 616 #define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS 617 #define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN 618 #define MBEDTLS_CIPHER_PADDING_ZEROS 619 620 /** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY 621 * 622 * Uncomment this macro to use a 128-bit key in the CTR_DRBG module. 623 * By default, CTR_DRBG uses a 256-bit key. 624 */ 625 //#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY 626 627 /** 628 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED 629 * 630 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve 631 * module. By default all supported curves are enabled. 632 * 633 * Comment macros to disable the curve and functions for it 634 */ 635 /* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */ 636 #define MBEDTLS_ECP_DP_SECP192R1_ENABLED 637 #define MBEDTLS_ECP_DP_SECP224R1_ENABLED 638 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED 639 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED 640 #define MBEDTLS_ECP_DP_SECP521R1_ENABLED 641 #define MBEDTLS_ECP_DP_SECP192K1_ENABLED 642 #define MBEDTLS_ECP_DP_SECP224K1_ENABLED 643 #define MBEDTLS_ECP_DP_SECP256K1_ENABLED 644 #define MBEDTLS_ECP_DP_BP256R1_ENABLED 645 #define MBEDTLS_ECP_DP_BP384R1_ENABLED 646 #define MBEDTLS_ECP_DP_BP512R1_ENABLED 647 /* Montgomery curves (supporting ECP) */ 648 #define MBEDTLS_ECP_DP_CURVE25519_ENABLED 649 #define MBEDTLS_ECP_DP_CURVE448_ENABLED 650 651 /** 652 * \def MBEDTLS_ECP_NIST_OPTIM 653 * 654 * Enable specific 'modulo p' routines for each NIST prime. 655 * Depending on the prime and architecture, makes operations 4 to 8 times 656 * faster on the corresponding curve. 657 * 658 * Comment this macro to disable NIST curves optimisation. 659 */ 660 #define MBEDTLS_ECP_NIST_OPTIM 661 662 /** 663 * \def MBEDTLS_ECP_RESTARTABLE 664 * 665 * Enable "non-blocking" ECC operations that can return early and be resumed. 666 * 667 * This allows various functions to pause by returning 668 * #MBEDTLS_ERR_ECP_IN_PROGRESS (or, for functions in the SSL module, 669 * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) and then be called later again in 670 * order to further progress and eventually complete their operation. This is 671 * controlled through mbedtls_ecp_set_max_ops() which limits the maximum 672 * number of ECC operations a function may perform before pausing; see 673 * mbedtls_ecp_set_max_ops() for more information. 674 * 675 * This is useful in non-threaded environments if you want to avoid blocking 676 * for too long on ECC (and, hence, X.509 or SSL/TLS) operations. 677 * 678 * This option: 679 * - Adds xxx_restartable() variants of existing operations in the 680 * following modules, with corresponding restart context types: 681 * - ECP (for Short Weierstrass curves only): scalar multiplication (mul), 682 * linear combination (muladd); 683 * - ECDSA: signature generation & verification; 684 * - PK: signature generation & verification; 685 * - X509: certificate chain verification. 686 * - Adds mbedtls_ecdh_enable_restart() in the ECDH module. 687 * - Changes the behaviour of TLS 1.2 clients (not servers) when using the 688 * ECDHE-ECDSA key exchange (not other key exchanges) to make all ECC 689 * computations restartable: 690 * - ECDH operations from the key exchange, only for Short Weierstass 691 * curves, only when MBEDTLS_USE_PSA_CRYPTO is not enabled. 692 * - verification of the server's key exchange signature; 693 * - verification of the server's certificate chain; 694 * - generation of the client's signature if client authentication is used, 695 * with an ECC key/certificate. 696 * 697 * \note In the cases above, the usual SSL/TLS functions, such as 698 * mbedtls_ssl_handshake(), can now return 699 * MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS. 700 * 701 * \note When this option and MBEDTLS_USE_PSA_CRYPTO are both enabled, 702 * restartable operations in PK, X.509 and TLS (see above) are not 703 * using PSA. On the other hand, ECDH computations in TLS are using 704 * PSA, and are not restartable. These are temporary limitations that 705 * should be lifted in the future. 706 * 707 * \note This option only works with the default software implementation of 708 * elliptic curve functionality. It is incompatible with 709 * MBEDTLS_ECP_ALT, MBEDTLS_ECDH_XXX_ALT, MBEDTLS_ECDSA_XXX_ALT. 710 * 711 * Requires: MBEDTLS_ECP_C 712 * 713 * Uncomment this macro to enable restartable ECC computations. 714 */ 715 //#define MBEDTLS_ECP_RESTARTABLE 716 717 /** 718 * \def MBEDTLS_ECDSA_DETERMINISTIC 719 * 720 * Enable deterministic ECDSA (RFC 6979). 721 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing 722 * may result in a compromise of the long-term signing key. This is avoided by 723 * the deterministic variant. 724 * 725 * Requires: MBEDTLS_HMAC_DRBG_C, MBEDTLS_ECDSA_C 726 * 727 * Comment this macro to disable deterministic ECDSA. 728 */ 729 #define MBEDTLS_ECDSA_DETERMINISTIC 730 731 /** 732 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED 733 * 734 * Enable the PSK based ciphersuite modes in SSL / TLS. 735 * 736 * This enables the following ciphersuites (if other requisites are 737 * enabled as well): 738 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 739 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 740 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 741 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 742 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 743 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 744 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 745 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 746 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 747 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 748 */ 749 #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED 750 751 /** 752 * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED 753 * 754 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. 755 * 756 * Requires: MBEDTLS_DHM_C 757 * 758 * This enables the following ciphersuites (if other requisites are 759 * enabled as well): 760 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 761 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 762 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 763 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 764 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 765 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 766 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 767 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 768 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 769 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 770 * 771 * \warning Using DHE constitutes a security risk as it 772 * is not possible to validate custom DH parameters. 773 * If possible, it is recommended users should consider 774 * preferring other methods of key exchange. 775 * See dhm.h for more details. 776 * 777 */ 778 #define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED 779 780 /** 781 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED 782 * 783 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. 784 * 785 * Requires: MBEDTLS_ECDH_C 786 * 787 * This enables the following ciphersuites (if other requisites are 788 * enabled as well): 789 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 790 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 791 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 792 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 793 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 794 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 795 */ 796 #define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED 797 798 /** 799 * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED 800 * 801 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. 802 * 803 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, 804 * MBEDTLS_X509_CRT_PARSE_C 805 * 806 * This enables the following ciphersuites (if other requisites are 807 * enabled as well): 808 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 809 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 810 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 811 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 812 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 813 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 814 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 815 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 816 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 817 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 818 */ 819 #define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED 820 821 /** 822 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED 823 * 824 * Enable the RSA-only based ciphersuite modes in SSL / TLS. 825 * 826 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, 827 * MBEDTLS_X509_CRT_PARSE_C 828 * 829 * This enables the following ciphersuites (if other requisites are 830 * enabled as well): 831 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 832 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 833 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 834 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 835 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 836 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 837 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 838 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 839 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 840 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 841 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 842 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 843 */ 844 #define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED 845 846 /** 847 * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED 848 * 849 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS. 850 * 851 * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, 852 * MBEDTLS_X509_CRT_PARSE_C 853 * 854 * This enables the following ciphersuites (if other requisites are 855 * enabled as well): 856 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 857 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 858 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 859 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 860 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 861 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 862 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 863 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 864 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 865 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 866 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 867 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 868 * 869 * \warning Using DHE constitutes a security risk as it 870 * is not possible to validate custom DH parameters. 871 * If possible, it is recommended users should consider 872 * preferring other methods of key exchange. 873 * See dhm.h for more details. 874 * 875 */ 876 #define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED 877 878 /** 879 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED 880 * 881 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. 882 * 883 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, 884 * MBEDTLS_X509_CRT_PARSE_C 885 * 886 * This enables the following ciphersuites (if other requisites are 887 * enabled as well): 888 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 889 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 890 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 891 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 892 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 893 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 894 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 895 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 896 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 897 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 898 */ 899 #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED 900 901 /** 902 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED 903 * 904 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. 905 * 906 * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C, 907 * 908 * This enables the following ciphersuites (if other requisites are 909 * enabled as well): 910 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 911 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 912 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 913 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 914 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 915 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 916 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 917 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 918 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 919 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 920 */ 921 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED 922 923 /** 924 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED 925 * 926 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. 927 * 928 * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C 929 * 930 * This enables the following ciphersuites (if other requisites are 931 * enabled as well): 932 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 933 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 934 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 935 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 936 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 937 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 938 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 939 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 940 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 941 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 942 */ 943 #define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED 944 945 /** 946 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED 947 * 948 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. 949 * 950 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_X509_CRT_PARSE_C 951 * 952 * This enables the following ciphersuites (if other requisites are 953 * enabled as well): 954 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 955 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 956 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 957 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 958 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 959 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 960 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 961 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 962 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 963 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 964 */ 965 #define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED 966 967 /** 968 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED 969 * 970 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS. 971 * 972 * \warning This is currently experimental. EC J-PAKE support is based on the 973 * Thread v1.0.0 specification; incompatible changes to the specification 974 * might still happen. For this reason, this is disabled by default. 975 * 976 * Requires: MBEDTLS_ECJPAKE_C 977 * SHA-256 (via MD if present, or via PSA, see MBEDTLS_ECJPAKE_C) 978 * MBEDTLS_ECP_DP_SECP256R1_ENABLED 979 * 980 * This enables the following ciphersuites (if other requisites are 981 * enabled as well): 982 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 983 */ 984 //#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED 985 986 /** 987 * \def MBEDTLS_PK_PARSE_EC_EXTENDED 988 * 989 * Enhance support for reading EC keys using variants of SEC1 not allowed by 990 * RFC 5915 and RFC 5480. 991 * 992 * Currently this means parsing the SpecifiedECDomain choice of EC 993 * parameters (only known groups are supported, not arbitrary domains, to 994 * avoid validation issues). 995 * 996 * Disable if you only need to support RFC 5915 + 5480 key formats. 997 */ 998 #define MBEDTLS_PK_PARSE_EC_EXTENDED 999 1000 /** 1001 * \def MBEDTLS_ERROR_STRERROR_DUMMY 1002 * 1003 * Enable a dummy error function to make use of mbedtls_strerror() in 1004 * third party libraries easier when MBEDTLS_ERROR_C is disabled 1005 * (no effect when MBEDTLS_ERROR_C is enabled). 1006 * 1007 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're 1008 * not using mbedtls_strerror() or error_strerror() in your application. 1009 * 1010 * Disable if you run into name conflicts and want to really remove the 1011 * mbedtls_strerror() 1012 */ 1013 #define MBEDTLS_ERROR_STRERROR_DUMMY 1014 1015 /** 1016 * \def MBEDTLS_GENPRIME 1017 * 1018 * Enable the prime-number generation code. 1019 * 1020 * Requires: MBEDTLS_BIGNUM_C 1021 */ 1022 #define MBEDTLS_GENPRIME 1023 1024 /** 1025 * \def MBEDTLS_FS_IO 1026 * 1027 * Enable functions that use the filesystem. 1028 */ 1029 #define MBEDTLS_FS_IO 1030 1031 /** 1032 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES 1033 * 1034 * Do not add default entropy sources in mbedtls_entropy_init(). 1035 * 1036 * This is useful to have more control over the added entropy sources in an 1037 * application. 1038 * 1039 * Uncomment this macro to prevent loading of default entropy functions. 1040 */ 1041 //#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES 1042 1043 /** 1044 * \def MBEDTLS_NO_PLATFORM_ENTROPY 1045 * 1046 * Do not use built-in platform entropy functions. 1047 * This is useful if your platform does not support 1048 * standards like the /dev/urandom or Windows CryptoAPI. 1049 * 1050 * Uncomment this macro to disable the built-in platform entropy functions. 1051 */ 1052 //#define MBEDTLS_NO_PLATFORM_ENTROPY 1053 1054 /** 1055 * \def MBEDTLS_ENTROPY_FORCE_SHA256 1056 * 1057 * Force the entropy accumulator to use a SHA-256 accumulator instead of the 1058 * default SHA-512 based one (if both are available). 1059 * 1060 * Requires: MBEDTLS_SHA256_C 1061 * 1062 * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option 1063 * if you have performance concerns. 1064 * 1065 * This option is only useful if both MBEDTLS_SHA256_C and 1066 * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. 1067 */ 1068 //#define MBEDTLS_ENTROPY_FORCE_SHA256 1069 1070 /** 1071 * \def MBEDTLS_ENTROPY_NV_SEED 1072 * 1073 * Enable the non-volatile (NV) seed file-based entropy source. 1074 * (Also enables the NV seed read/write functions in the platform layer) 1075 * 1076 * This is crucial (if not required) on systems that do not have a 1077 * cryptographic entropy source (in hardware or kernel) available. 1078 * 1079 * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C 1080 * 1081 * \note The read/write functions that are used by the entropy source are 1082 * determined in the platform layer, and can be modified at runtime and/or 1083 * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used. 1084 * 1085 * \note If you use the default implementation functions that read a seedfile 1086 * with regular fopen(), please make sure you make a seedfile with the 1087 * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at 1088 * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from 1089 * and written to or you will get an entropy source error! The default 1090 * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE 1091 * bytes from the file. 1092 * 1093 * \note The entropy collector will write to the seed file before entropy is 1094 * given to an external source, to update it. 1095 */ 1096 //#define MBEDTLS_ENTROPY_NV_SEED 1097 1098 /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER 1099 * 1100 * Enable key identifiers that encode a key owner identifier. 1101 * 1102 * The owner of a key is identified by a value of type ::mbedtls_key_owner_id_t 1103 * which is currently hard-coded to be int32_t. 1104 * 1105 * Note that this option is meant for internal use only and may be removed 1106 * without notice. 1107 */ 1108 //#define MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER 1109 1110 /** 1111 * \def MBEDTLS_MEMORY_DEBUG 1112 * 1113 * Enable debugging of buffer allocator memory issues. Automatically prints 1114 * (to stderr) all (fatal) messages on memory allocation issues. Enables 1115 * function for 'debug output' of allocated memory. 1116 * 1117 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C 1118 * 1119 * Uncomment this macro to let the buffer allocator print out error messages. 1120 */ 1121 //#define MBEDTLS_MEMORY_DEBUG 1122 1123 /** 1124 * \def MBEDTLS_MEMORY_BACKTRACE 1125 * 1126 * Include backtrace information with each allocated block. 1127 * 1128 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C 1129 * GLIBC-compatible backtrace() and backtrace_symbols() support 1130 * 1131 * Uncomment this macro to include backtrace information 1132 */ 1133 //#define MBEDTLS_MEMORY_BACKTRACE 1134 1135 /** 1136 * \def MBEDTLS_PK_RSA_ALT_SUPPORT 1137 * 1138 * Support external private RSA keys (eg from a HSM) in the PK layer. 1139 * 1140 * Comment this macro to disable support for external private RSA keys. 1141 */ 1142 #define MBEDTLS_PK_RSA_ALT_SUPPORT 1143 1144 /** 1145 * \def MBEDTLS_PKCS1_V15 1146 * 1147 * Enable support for PKCS#1 v1.5 encoding. 1148 * 1149 * Requires: MBEDTLS_RSA_C 1150 * 1151 * This enables support for PKCS#1 v1.5 operations. 1152 */ 1153 #define MBEDTLS_PKCS1_V15 1154 1155 /** 1156 * \def MBEDTLS_PKCS1_V21 1157 * 1158 * Enable support for PKCS#1 v2.1 encoding. 1159 * 1160 * Requires: MBEDTLS_RSA_C and (MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C). 1161 * 1162 * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() 1163 * before doing any PKCS#1 v2.1 operation. 1164 * 1165 * \warning When building with MBEDTLS_MD_C, all hashes used with this 1166 * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, 1167 * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by 1168 * this module in builds where MBEDTLS_MD_C is disabled. 1169 * 1170 * This enables support for RSAES-OAEP and RSASSA-PSS operations. 1171 */ 1172 #define MBEDTLS_PKCS1_V21 1173 1174 /** \def MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS 1175 * 1176 * Enable support for platform built-in keys. If you enable this feature, 1177 * you must implement the function mbedtls_psa_platform_get_builtin_key(). 1178 * See the documentation of that function for more information. 1179 * 1180 * Built-in keys are typically derived from a hardware unique key or 1181 * stored in a secure element. 1182 * 1183 * Requires: MBEDTLS_PSA_CRYPTO_C. 1184 * 1185 * \warning This interface is experimental and may change or be removed 1186 * without notice. 1187 */ 1188 //#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS 1189 1190 /** \def MBEDTLS_PSA_CRYPTO_CLIENT 1191 * 1192 * Enable support for PSA crypto client. 1193 * 1194 * \note This option allows to include the code necessary for a PSA 1195 * crypto client when the PSA crypto implementation is not included in 1196 * the library (MBEDTLS_PSA_CRYPTO_C disabled). The code included is the 1197 * code to set and get PSA key attributes. 1198 * The development of PSA drivers partially relying on the library to 1199 * fulfill the hardware gaps is another possible usage of this option. 1200 * 1201 * \warning This interface is experimental and may change or be removed 1202 * without notice. 1203 */ 1204 //#define MBEDTLS_PSA_CRYPTO_CLIENT 1205 1206 /** \def MBEDTLS_PSA_CRYPTO_DRIVERS 1207 * 1208 * Enable support for the experimental PSA crypto driver interface. 1209 * 1210 * Requires: MBEDTLS_PSA_CRYPTO_C 1211 * 1212 * \warning This interface is experimental. We intend to maintain backward 1213 * compatibility with application code that relies on drivers, 1214 * but the driver interfaces may change without notice. 1215 */ 1216 //#define MBEDTLS_PSA_CRYPTO_DRIVERS 1217 1218 /** \def MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG 1219 * 1220 * Make the PSA Crypto module use an external random generator provided 1221 * by a driver, instead of Mbed TLS's entropy and DRBG modules. 1222 * 1223 * \note This random generator must deliver random numbers with cryptographic 1224 * quality and high performance. It must supply unpredictable numbers 1225 * with a uniform distribution. The implementation of this function 1226 * is responsible for ensuring that the random generator is seeded 1227 * with sufficient entropy. If you have a hardware TRNG which is slow 1228 * or delivers non-uniform output, declare it as an entropy source 1229 * with mbedtls_entropy_add_source() instead of enabling this option. 1230 * 1231 * If you enable this option, you must configure the type 1232 * ::mbedtls_psa_external_random_context_t in psa/crypto_platform.h 1233 * and define a function called mbedtls_psa_external_get_random() 1234 * with the following prototype: 1235 * ``` 1236 * psa_status_t mbedtls_psa_external_get_random( 1237 * mbedtls_psa_external_random_context_t *context, 1238 * uint8_t *output, size_t output_size, size_t *output_length); 1239 * ); 1240 * ``` 1241 * The \c context value is initialized to 0 before the first call. 1242 * The function must fill the \c output buffer with \p output_size bytes 1243 * of random data and set \c *output_length to \p output_size. 1244 * 1245 * Requires: MBEDTLS_PSA_CRYPTO_C 1246 * 1247 * \warning If you enable this option, code that uses the PSA cryptography 1248 * interface will not use any of the entropy sources set up for 1249 * the entropy module, nor the NV seed that MBEDTLS_ENTROPY_NV_SEED 1250 * enables. 1251 * 1252 * \note This option is experimental and may be removed without notice. 1253 */ 1254 //#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG 1255 1256 /** 1257 * \def MBEDTLS_PSA_CRYPTO_SPM 1258 * 1259 * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure 1260 * Partition Manager) integration which separates the code into two parts: a 1261 * NSPE (Non-Secure Process Environment) and an SPE (Secure Process 1262 * Environment). 1263 * 1264 * Module: library/psa_crypto.c 1265 * Requires: MBEDTLS_PSA_CRYPTO_C 1266 * 1267 */ 1268 //#define MBEDTLS_PSA_CRYPTO_SPM 1269 1270 /** 1271 * \def MBEDTLS_PSA_INJECT_ENTROPY 1272 * 1273 * Enable support for entropy injection at first boot. This feature is 1274 * required on systems that do not have a built-in entropy source (TRNG). 1275 * This feature is currently not supported on systems that have a built-in 1276 * entropy source. 1277 * 1278 * Requires: MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_ENTROPY_NV_SEED 1279 * 1280 */ 1281 //#define MBEDTLS_PSA_INJECT_ENTROPY 1282 1283 /** 1284 * \def MBEDTLS_RSA_NO_CRT 1285 * 1286 * Do not use the Chinese Remainder Theorem 1287 * for the RSA private operation. 1288 * 1289 * Uncomment this macro to disable the use of CRT in RSA. 1290 * 1291 */ 1292 //#define MBEDTLS_RSA_NO_CRT 1293 1294 /** 1295 * \def MBEDTLS_SELF_TEST 1296 * 1297 * Enable the checkup functions (*_self_test). 1298 */ 1299 #define MBEDTLS_SELF_TEST 1300 1301 /** 1302 * \def MBEDTLS_SHA256_SMALLER 1303 * 1304 * Enable an implementation of SHA-256 that has lower ROM footprint but also 1305 * lower performance. 1306 * 1307 * The default implementation is meant to be a reasonable compromise between 1308 * performance and size. This version optimizes more aggressively for size at 1309 * the expense of performance. Eg on Cortex-M4 it reduces the size of 1310 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about 1311 * 30%. 1312 * 1313 * Uncomment to enable the smaller implementation of SHA256. 1314 */ 1315 //#define MBEDTLS_SHA256_SMALLER 1316 1317 /** 1318 * \def MBEDTLS_SHA512_SMALLER 1319 * 1320 * Enable an implementation of SHA-512 that has lower ROM footprint but also 1321 * lower performance. 1322 * 1323 * Uncomment to enable the smaller implementation of SHA512. 1324 */ 1325 //#define MBEDTLS_SHA512_SMALLER 1326 1327 /** 1328 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES 1329 * 1330 * Enable sending of alert messages in case of encountered errors as per RFC. 1331 * If you choose not to send the alert messages, mbed TLS can still communicate 1332 * with other servers, only debugging of failures is harder. 1333 * 1334 * The advantage of not sending alert messages, is that no information is given 1335 * about reasons for failures thus preventing adversaries of gaining intel. 1336 * 1337 * Enable sending of all alert messages 1338 */ 1339 #define MBEDTLS_SSL_ALL_ALERT_MESSAGES 1340 1341 /** 1342 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID 1343 * 1344 * Enable support for the DTLS Connection ID (CID) extension, 1345 * which allows to identify DTLS connections across changes 1346 * in the underlying transport. The CID functionality is described 1347 * in RFC 9146. 1348 * 1349 * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`, 1350 * mbedtls_ssl_get_own_cid()`, `mbedtls_ssl_get_peer_cid()` and 1351 * `mbedtls_ssl_conf_cid()`. See the corresponding documentation for 1352 * more information. 1353 * 1354 * The maximum lengths of outgoing and incoming CIDs can be configured 1355 * through the options 1356 * - MBEDTLS_SSL_CID_OUT_LEN_MAX 1357 * - MBEDTLS_SSL_CID_IN_LEN_MAX. 1358 * 1359 * Requires: MBEDTLS_SSL_PROTO_DTLS 1360 * 1361 * Uncomment to enable the Connection ID extension. 1362 */ 1363 #define MBEDTLS_SSL_DTLS_CONNECTION_ID 1364 1365 1366 /** 1367 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 1368 * 1369 * Defines whether RFC 9146 (default) or the legacy version 1370 * (version draft-ietf-tls-dtls-connection-id-05, 1371 * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05) 1372 * is used. 1373 * 1374 * Set the value to 0 for the standard version, and 1375 * 1 for the legacy draft version. 1376 * 1377 * \deprecated Support for the legacy version of the DTLS 1378 * Connection ID feature is deprecated. Please 1379 * switch to the standardized version defined 1380 * in RFC 9146 enabled by utilizing 1381 * MBEDTLS_SSL_DTLS_CONNECTION_ID without use 1382 * of MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT. 1383 * 1384 * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID 1385 */ 1386 #define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 0 1387 1388 /** 1389 * \def MBEDTLS_SSL_ASYNC_PRIVATE 1390 * 1391 * Enable asynchronous external private key operations in SSL. This allows 1392 * you to configure an SSL connection to call an external cryptographic 1393 * module to perform private key operations instead of performing the 1394 * operation inside the library. 1395 * 1396 */ 1397 //#define MBEDTLS_SSL_ASYNC_PRIVATE 1398 1399 /** 1400 * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION 1401 * 1402 * Enable serialization of the TLS context structures, through use of the 1403 * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load(). 1404 * 1405 * This pair of functions allows one side of a connection to serialize the 1406 * context associated with the connection, then free or re-use that context 1407 * while the serialized state is persisted elsewhere, and finally deserialize 1408 * that state to a live context for resuming read/write operations on the 1409 * connection. From a protocol perspective, the state of the connection is 1410 * unaffected, in particular this is entirely transparent to the peer. 1411 * 1412 * Note: this is distinct from TLS session resumption, which is part of the 1413 * protocol and fully visible by the peer. TLS session resumption enables 1414 * establishing new connections associated to a saved session with shorter, 1415 * lighter handshakes, while context serialization is a local optimization in 1416 * handling a single, potentially long-lived connection. 1417 * 1418 * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are 1419 * saved after the handshake to allow for more efficient serialization, so if 1420 * you don't need this feature you'll save RAM by disabling it. 1421 * 1422 * Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C 1423 * 1424 * Comment to disable the context serialization APIs. 1425 */ 1426 #define MBEDTLS_SSL_CONTEXT_SERIALIZATION 1427 1428 /** 1429 * \def MBEDTLS_SSL_DEBUG_ALL 1430 * 1431 * Enable the debug messages in SSL module for all issues. 1432 * Debug messages have been disabled in some places to prevent timing 1433 * attacks due to (unbalanced) debugging function calls. 1434 * 1435 * If you need all error reporting you should enable this during debugging, 1436 * but remove this for production servers that should log as well. 1437 * 1438 * Uncomment this macro to report all debug messages on errors introducing 1439 * a timing side-channel. 1440 * 1441 */ 1442 //#define MBEDTLS_SSL_DEBUG_ALL 1443 1444 /** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC 1445 * 1446 * Enable support for Encrypt-then-MAC, RFC 7366. 1447 * 1448 * This allows peers that both support it to use a more robust protection for 1449 * ciphersuites using CBC, providing deep resistance against timing attacks 1450 * on the padding or underlying cipher. 1451 * 1452 * This only affects CBC ciphersuites, and is useless if none is defined. 1453 * 1454 * Requires: MBEDTLS_SSL_PROTO_TLS1_2 1455 * 1456 * Comment this macro to disable support for Encrypt-then-MAC 1457 */ 1458 #define MBEDTLS_SSL_ENCRYPT_THEN_MAC 1459 1460 /** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET 1461 * 1462 * Enable support for RFC 7627: Session Hash and Extended Master Secret 1463 * Extension. 1464 * 1465 * This was introduced as "the proper fix" to the Triple Handshake family of 1466 * attacks, but it is recommended to always use it (even if you disable 1467 * renegotiation), since it actually fixes a more fundamental issue in the 1468 * original SSL/TLS design, and has implications beyond Triple Handshake. 1469 * 1470 * Requires: MBEDTLS_SSL_PROTO_TLS1_2 1471 * 1472 * Comment this macro to disable support for Extended Master Secret. 1473 */ 1474 #define MBEDTLS_SSL_EXTENDED_MASTER_SECRET 1475 1476 /** 1477 * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE 1478 * 1479 * This option controls the availability of the API mbedtls_ssl_get_peer_cert() 1480 * giving access to the peer's certificate after completion of the handshake. 1481 * 1482 * Unless you need mbedtls_ssl_peer_cert() in your application, it is 1483 * recommended to disable this option for reduced RAM usage. 1484 * 1485 * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still 1486 * defined, but always returns \c NULL. 1487 * 1488 * \note This option has no influence on the protection against the 1489 * triple handshake attack. Even if it is disabled, Mbed TLS will 1490 * still ensure that certificates do not change during renegotiation, 1491 * for example by keeping a hash of the peer's certificate. 1492 * 1493 * \note This option is required if MBEDTLS_SSL_PROTO_TLS1_3 is set. 1494 * 1495 * Comment this macro to disable storing the peer's certificate 1496 * after the handshake. 1497 */ 1498 #define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE 1499 1500 /** 1501 * \def MBEDTLS_SSL_RENEGOTIATION 1502 * 1503 * Enable support for TLS renegotiation. 1504 * 1505 * The two main uses of renegotiation are (1) refresh keys on long-lived 1506 * connections and (2) client authentication after the initial handshake. 1507 * If you don't need renegotiation, it's probably better to disable it, since 1508 * it has been associated with security issues in the past and is easy to 1509 * misuse/misunderstand. 1510 * 1511 * Comment this to disable support for renegotiation. 1512 * 1513 * \note Even if this option is disabled, both client and server are aware 1514 * of the Renegotiation Indication Extension (RFC 5746) used to 1515 * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1). 1516 * (See \c mbedtls_ssl_conf_legacy_renegotiation for the 1517 * configuration of this extension). 1518 * 1519 */ 1520 #define MBEDTLS_SSL_RENEGOTIATION 1521 1522 /** 1523 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH 1524 * 1525 * Enable support for RFC 6066 max_fragment_length extension in SSL. 1526 * 1527 * Comment this macro to disable support for the max_fragment_length extension 1528 */ 1529 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH 1530 1531 /** 1532 * \def MBEDTLS_SSL_PROTO_TLS1_2 1533 * 1534 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). 1535 * 1536 * Requires: Without MBEDTLS_USE_PSA_CRYPTO: MBEDTLS_MD_C and 1537 * (MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C) 1538 * With MBEDTLS_USE_PSA_CRYPTO: 1539 * PSA_WANT_ALG_SHA_1 or PSA_WANT_ALG_SHA_256 or 1540 * PSA_WANT_ALG_SHA_512 1541 * 1542 * \warning If building with MBEDTLS_USE_PSA_CRYPTO, you must call 1543 * psa_crypto_init() before doing any TLS operations. 1544 * 1545 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 1546 */ 1547 #define MBEDTLS_SSL_PROTO_TLS1_2 1548 1549 /** 1550 * \def MBEDTLS_SSL_PROTO_TLS1_3 1551 * 1552 * Enable support for TLS 1.3. 1553 * 1554 * \note The support for TLS 1.3 is not comprehensive yet, in particular 1555 * pre-shared keys are not supported. 1556 * See docs/architecture/tls13-support.md for a description of the TLS 1557 * 1.3 support that this option enables. 1558 * 1559 * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE 1560 * Requires: MBEDTLS_PSA_CRYPTO_C 1561 * 1562 * Note: even though TLS 1.3 depends on PSA Crypto, and uses it unconditionally 1563 * for most operations, if you want it to only use PSA for all crypto 1564 * operations, you need to also enable MBEDTLS_USE_PSA_CRYPTO; otherwise X.509 1565 * operations, and functions that are common with TLS 1.2 (record protection, 1566 * running handshake hash) will still use non-PSA crypto. 1567 * 1568 * Uncomment this macro to enable the support for TLS 1.3. 1569 */ 1570 //#define MBEDTLS_SSL_PROTO_TLS1_3 1571 1572 /** 1573 * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE 1574 * 1575 * Enable TLS 1.3 middlebox compatibility mode. 1576 * 1577 * As specified in Section D.4 of RFC 8446, TLS 1.3 offers a compatibility 1578 * mode to make a TLS 1.3 connection more likely to pass through middle boxes 1579 * expecting TLS 1.2 traffic. 1580 * 1581 * Turning on the compatibility mode comes at the cost of a few added bytes 1582 * on the wire, but it doesn't affect compatibility with TLS 1.3 implementations 1583 * that don't use it. Therefore, unless transmission bandwidth is critical and 1584 * you know that middlebox compatibility issues won't occur, it is therefore 1585 * recommended to set this option. 1586 * 1587 * Comment to disable compatibility mode for TLS 1.3. If 1588 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any 1589 * effect on the build. 1590 * 1591 */ 1592 //#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE 1593 1594 /** 1595 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED 1596 * 1597 * Enable TLS 1.3 PSK key exchange mode. 1598 * 1599 * Comment to disable support for the PSK key exchange mode in TLS 1.3. If 1600 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any 1601 * effect on the build. 1602 * 1603 */ 1604 #define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED 1605 1606 /** 1607 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED 1608 * 1609 * Enable TLS 1.3 ephemeral key exchange mode. 1610 * 1611 * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C, MBEDTLS_ECDSA_C or 1612 * MBEDTLS_PKCS1_V21 1613 * 1614 * Comment to disable support for the ephemeral key exchange mode in TLS 1.3. 1615 * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any 1616 * effect on the build. 1617 * 1618 */ 1619 #define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED 1620 1621 /** 1622 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED 1623 * 1624 * Enable TLS 1.3 PSK ephemeral key exchange mode. 1625 * 1626 * Requires: MBEDTLS_ECDH_C 1627 * 1628 * Comment to disable support for the PSK ephemeral key exchange mode in 1629 * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not 1630 * have any effect on the build. 1631 * 1632 */ 1633 #define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED 1634 1635 /** 1636 * \def MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 1637 * 1638 * Maximum time difference in milliseconds tolerated between the age of a 1639 * ticket from the server and client point of view. 1640 * From the client point of view, the age of a ticket is the time difference 1641 * between the time when the client proposes to the server to use the ticket 1642 * (time of writing of the Pre-Shared Key Extension including the ticket) and 1643 * the time the client received the ticket from the server. 1644 * From the server point of view, the age of a ticket is the time difference 1645 * between the time when the server receives a proposition from the client 1646 * to use the ticket and the time when the ticket was created by the server. 1647 * The server age is expected to be always greater than the client one and 1648 * MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE defines the 1649 * maximum difference tolerated for the server to accept the ticket. 1650 * This is not used in TLS 1.2. 1651 * 1652 */ 1653 #define MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 6000 1654 1655 /** 1656 * \def MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH 1657 * 1658 * Size in bytes of a ticket nonce. This is not used in TLS 1.2. 1659 * 1660 * This must be less than 256. 1661 */ 1662 #define MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH 32 1663 1664 /** 1665 * \def MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1666 * 1667 * Default number of NewSessionTicket messages to be sent by a TLS 1.3 server 1668 * after handshake completion. This is not used in TLS 1.2 and relevant only if 1669 * the MBEDTLS_SSL_SESSION_TICKETS option is enabled. 1670 * 1671 */ 1672 #define MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1 1673 1674 /** 1675 * \def MBEDTLS_SSL_EARLY_DATA 1676 * 1677 * Enable support for RFC 8446 TLS 1.3 early data. 1678 * 1679 * Requires: MBEDTLS_SSL_SESSION_TICKETS and either 1680 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or 1681 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED 1682 * 1683 * Comment this to disable support for early data. If MBEDTLS_SSL_PROTO_TLS1_3 1684 * is not enabled, this option does not have any effect on the build. 1685 * 1686 * This feature is experimental, not completed and thus not ready for 1687 * production. 1688 * 1689 */ 1690 //#define MBEDTLS_SSL_EARLY_DATA 1691 1692 /** 1693 * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1694 * 1695 * The default maximum amount of 0-RTT data. See the documentation of 1696 * \c mbedtls_ssl_tls13_conf_max_early_data_size() for more information. 1697 * 1698 * It must be positive and smaller than UINT32_MAX. 1699 * 1700 * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not 1701 * have any impact on the build. 1702 * 1703 * This feature is experimental, not completed and thus not ready for 1704 * production. 1705 * 1706 */ 1707 #define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1024 1708 1709 /** 1710 * \def MBEDTLS_SSL_PROTO_DTLS 1711 * 1712 * Enable support for DTLS (all available versions). 1713 * 1714 * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. 1715 * 1716 * Requires: MBEDTLS_SSL_PROTO_TLS1_2 1717 * 1718 * Comment this macro to disable support for DTLS 1719 */ 1720 #define MBEDTLS_SSL_PROTO_DTLS 1721 1722 /** 1723 * \def MBEDTLS_SSL_ALPN 1724 * 1725 * Enable support for RFC 7301 Application Layer Protocol Negotiation. 1726 * 1727 * Comment this macro to disable support for ALPN. 1728 */ 1729 #define MBEDTLS_SSL_ALPN 1730 1731 /** 1732 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY 1733 * 1734 * Enable support for the anti-replay mechanism in DTLS. 1735 * 1736 * Requires: MBEDTLS_SSL_TLS_C 1737 * MBEDTLS_SSL_PROTO_DTLS 1738 * 1739 * \warning Disabling this is often a security risk! 1740 * See mbedtls_ssl_conf_dtls_anti_replay() for details. 1741 * 1742 * Comment this to disable anti-replay in DTLS. 1743 */ 1744 #define MBEDTLS_SSL_DTLS_ANTI_REPLAY 1745 1746 /** 1747 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY 1748 * 1749 * Enable support for HelloVerifyRequest on DTLS servers. 1750 * 1751 * This feature is highly recommended to prevent DTLS servers being used as 1752 * amplifiers in DoS attacks against other hosts. It should always be enabled 1753 * unless you know for sure amplification cannot be a problem in the 1754 * environment in which your server operates. 1755 * 1756 * \warning Disabling this can be a security risk! (see above) 1757 * 1758 * Requires: MBEDTLS_SSL_PROTO_DTLS 1759 * 1760 * Comment this to disable support for HelloVerifyRequest. 1761 */ 1762 #define MBEDTLS_SSL_DTLS_HELLO_VERIFY 1763 1764 /** 1765 * \def MBEDTLS_SSL_DTLS_SRTP 1766 * 1767 * Enable support for negotiation of DTLS-SRTP (RFC 5764) 1768 * through the use_srtp extension. 1769 * 1770 * \note This feature provides the minimum functionality required 1771 * to negotiate the use of DTLS-SRTP and to allow the derivation of 1772 * the associated SRTP packet protection key material. 1773 * In particular, the SRTP packet protection itself, as well as the 1774 * demultiplexing of RTP and DTLS packets at the datagram layer 1775 * (see Section 5 of RFC 5764), are not handled by this feature. 1776 * Instead, after successful completion of a handshake negotiating 1777 * the use of DTLS-SRTP, the extended key exporter API 1778 * mbedtls_ssl_conf_export_keys_cb() should be used to implement 1779 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705 1780 * (this is implemented in the SSL example programs). 1781 * The resulting key should then be passed to an SRTP stack. 1782 * 1783 * Setting this option enables the runtime API 1784 * mbedtls_ssl_conf_dtls_srtp_protection_profiles() 1785 * through which the supported DTLS-SRTP protection 1786 * profiles can be configured. You must call this API at 1787 * runtime if you wish to negotiate the use of DTLS-SRTP. 1788 * 1789 * Requires: MBEDTLS_SSL_PROTO_DTLS 1790 * 1791 * Uncomment this to enable support for use_srtp extension. 1792 */ 1793 //#define MBEDTLS_SSL_DTLS_SRTP 1794 1795 /** 1796 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE 1797 * 1798 * Enable server-side support for clients that reconnect from the same port. 1799 * 1800 * Some clients unexpectedly close the connection and try to reconnect using the 1801 * same source port. This needs special support from the server to handle the 1802 * new connection securely, as described in section 4.2.8 of RFC 6347. This 1803 * flag enables that support. 1804 * 1805 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY 1806 * 1807 * Comment this to disable support for clients reusing the source port. 1808 */ 1809 #define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE 1810 1811 /** 1812 * \def MBEDTLS_SSL_SESSION_TICKETS 1813 * 1814 * Enable support for RFC 5077 session tickets in SSL. 1815 * Client-side, provides full support for session tickets (maintenance of a 1816 * session store remains the responsibility of the application, though). 1817 * Server-side, you also need to provide callbacks for writing and parsing 1818 * tickets, including authenticated encryption and key management. Example 1819 * callbacks are provided by MBEDTLS_SSL_TICKET_C. 1820 * 1821 * Comment this macro to disable support for SSL session tickets 1822 */ 1823 #define MBEDTLS_SSL_SESSION_TICKETS 1824 1825 /** 1826 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION 1827 * 1828 * Enable support for RFC 6066 server name indication (SNI) in SSL. 1829 * 1830 * Requires: MBEDTLS_X509_CRT_PARSE_C 1831 * 1832 * Comment this macro to disable support for server name indication in SSL 1833 */ 1834 #define MBEDTLS_SSL_SERVER_NAME_INDICATION 1835 1836 /** 1837 * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH 1838 * 1839 * When this option is enabled, the SSL buffer will be resized automatically 1840 * based on the negotiated maximum fragment length in each direction. 1841 * 1842 * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH 1843 */ 1844 //#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH 1845 1846 /** 1847 * \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN 1848 * 1849 * Enable testing of the constant-flow nature of some sensitive functions with 1850 * clang's MemorySanitizer. This causes some existing tests to also test 1851 * this non-functional property of the code under test. 1852 * 1853 * This setting requires compiling with clang -fsanitize=memory. The test 1854 * suites can then be run normally. 1855 * 1856 * \warning This macro is only used for extended testing; it is not considered 1857 * part of the library's API, so it may change or disappear at any time. 1858 * 1859 * Uncomment to enable testing of the constant-flow nature of selected code. 1860 */ 1861 //#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN 1862 1863 /** 1864 * \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND 1865 * 1866 * Enable testing of the constant-flow nature of some sensitive functions with 1867 * valgrind's memcheck tool. This causes some existing tests to also test 1868 * this non-functional property of the code under test. 1869 * 1870 * This setting requires valgrind headers for building, and is only useful for 1871 * testing if the tests suites are run with valgrind's memcheck. This can be 1872 * done for an individual test suite with 'valgrind ./test_suite_xxx', or when 1873 * using CMake, this can be done for all test suites with 'make memcheck'. 1874 * 1875 * \warning This macro is only used for extended testing; it is not considered 1876 * part of the library's API, so it may change or disappear at any time. 1877 * 1878 * Uncomment to enable testing of the constant-flow nature of selected code. 1879 */ 1880 //#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND 1881 1882 /** 1883 * \def MBEDTLS_TEST_HOOKS 1884 * 1885 * Enable features for invasive testing such as introspection functions and 1886 * hooks for fault injection. This enables additional unit tests. 1887 * 1888 * Merely enabling this feature should not change the behavior of the product. 1889 * It only adds new code, and new branching points where the default behavior 1890 * is the same as when this feature is disabled. 1891 * However, this feature increases the attack surface: there is an added 1892 * risk of vulnerabilities, and more gadgets that can make exploits easier. 1893 * Therefore this feature must never be enabled in production. 1894 * 1895 * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more 1896 * information. 1897 * 1898 * Uncomment to enable invasive tests. 1899 */ 1900 //#define MBEDTLS_TEST_HOOKS 1901 1902 /** 1903 * \def MBEDTLS_THREADING_ALT 1904 * 1905 * Provide your own alternate threading implementation. 1906 * 1907 * Requires: MBEDTLS_THREADING_C 1908 * 1909 * Uncomment this to allow your own alternate threading implementation. 1910 */ 1911 //#define MBEDTLS_THREADING_ALT 1912 1913 /** 1914 * \def MBEDTLS_THREADING_PTHREAD 1915 * 1916 * Enable the pthread wrapper layer for the threading layer. 1917 * 1918 * Requires: MBEDTLS_THREADING_C 1919 * 1920 * Uncomment this to enable pthread mutexes. 1921 */ 1922 //#define MBEDTLS_THREADING_PTHREAD 1923 1924 /** 1925 * \def MBEDTLS_USE_PSA_CRYPTO 1926 * 1927 * Make the X.509 and TLS library use PSA for cryptographic operations, and 1928 * enable new APIs for using keys handled by PSA Crypto. 1929 * 1930 * \note Development of this option is currently in progress, and parts of Mbed 1931 * TLS's X.509 and TLS modules are not ported to PSA yet. However, these parts 1932 * will still continue to work as usual, so enabling this option should not 1933 * break backwards compatibility. 1934 * 1935 * \note See docs/use-psa-crypto.md for a complete description of what this 1936 * option currently does, and of parts that are not affected by it so far. 1937 * 1938 * \warning If you enable this option, you need to call `psa_crypto_init()` 1939 * before calling any function from the SSL/TLS, X.509 or PK modules. 1940 * 1941 * Requires: MBEDTLS_PSA_CRYPTO_C. 1942 * 1943 * Uncomment this to enable internal use of PSA Crypto and new associated APIs. 1944 */ 1945 //#define MBEDTLS_USE_PSA_CRYPTO 1946 1947 /** 1948 * \def MBEDTLS_PSA_CRYPTO_CONFIG 1949 * 1950 * This setting allows support for cryptographic mechanisms through the PSA 1951 * API to be configured separately from support through the mbedtls API. 1952 * 1953 * When this option is disabled, the PSA API exposes the cryptographic 1954 * mechanisms that can be implemented on top of the `mbedtls_xxx` API 1955 * configured with `MBEDTLS_XXX` symbols. 1956 * 1957 * When this option is enabled, the PSA API exposes the cryptographic 1958 * mechanisms requested by the `PSA_WANT_XXX` symbols defined in 1959 * include/psa/crypto_config.h. The corresponding `MBEDTLS_XXX` settings are 1960 * automatically enabled if required (i.e. if no PSA driver provides the 1961 * mechanism). You may still freely enable additional `MBEDTLS_XXX` symbols 1962 * in mbedtls_config.h. 1963 * 1964 * If the symbol #MBEDTLS_PSA_CRYPTO_CONFIG_FILE is defined, it specifies 1965 * an alternative header to include instead of include/psa/crypto_config.h. 1966 * 1967 * This feature is still experimental and is not ready for production since 1968 * it is not completed. 1969 */ 1970 //#define MBEDTLS_PSA_CRYPTO_CONFIG 1971 1972 /** 1973 * \def MBEDTLS_VERSION_FEATURES 1974 * 1975 * Allow run-time checking of compile-time enabled features. Thus allowing users 1976 * to check at run-time if the library is for instance compiled with threading 1977 * support via mbedtls_version_check_feature(). 1978 * 1979 * Requires: MBEDTLS_VERSION_C 1980 * 1981 * Comment this to disable run-time checking and save ROM space 1982 */ 1983 #define MBEDTLS_VERSION_FEATURES 1984 1985 /** 1986 * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK 1987 * 1988 * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()` 1989 * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure 1990 * the set of trusted certificates through a callback instead of a linked 1991 * list. 1992 * 1993 * This is useful for example in environments where a large number of trusted 1994 * certificates is present and storing them in a linked list isn't efficient 1995 * enough, or when the set of trusted certificates changes frequently. 1996 * 1997 * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and 1998 * `mbedtls_ssl_conf_ca_cb()` for more information. 1999 * 2000 * Uncomment to enable trusted certificate callbacks. 2001 */ 2002 //#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK 2003 2004 /** 2005 * \def MBEDTLS_X509_REMOVE_INFO 2006 * 2007 * Disable mbedtls_x509_*_info() and related APIs. 2008 * 2009 * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt() 2010 * and other functions/constants only used by these functions, thus reducing 2011 * the code footprint by several KB. 2012 */ 2013 //#define MBEDTLS_X509_REMOVE_INFO 2014 2015 /** 2016 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT 2017 * 2018 * Enable parsing and verification of X.509 certificates, CRLs and CSRS 2019 * signed with RSASSA-PSS (aka PKCS#1 v2.1). 2020 * 2021 * Comment this macro to disallow using RSASSA-PSS in certificates. 2022 */ 2023 #define MBEDTLS_X509_RSASSA_PSS_SUPPORT 2024 /** \} name SECTION: mbed TLS feature support */ 2025 2026 /** 2027 * \name SECTION: mbed TLS modules 2028 * 2029 * This section enables or disables entire modules in mbed TLS 2030 * \{ 2031 */ 2032 2033 /** 2034 * \def MBEDTLS_AESNI_C 2035 * 2036 * Enable AES-NI support on x86-64. 2037 * 2038 * Module: library/aesni.c 2039 * Caller: library/aes.c 2040 * 2041 * Requires: MBEDTLS_HAVE_ASM 2042 * 2043 * This modules adds support for the AES-NI instructions on x86-64 2044 */ 2045 #define MBEDTLS_AESNI_C 2046 2047 /** 2048 * \def MBEDTLS_AES_C 2049 * 2050 * Enable the AES block cipher. 2051 * 2052 * Module: library/aes.c 2053 * Caller: library/cipher.c 2054 * library/pem.c 2055 * library/ctr_drbg.c 2056 * 2057 * This module enables the following ciphersuites (if other requisites are 2058 * enabled as well): 2059 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 2060 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 2061 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 2062 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 2063 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 2064 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 2065 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 2066 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 2067 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 2068 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 2069 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 2070 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 2071 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 2072 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 2073 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 2074 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 2075 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 2076 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 2077 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 2078 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 2079 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 2080 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 2081 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 2082 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 2083 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 2084 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 2085 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 2086 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 2087 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 2088 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 2089 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 2090 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 2091 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 2092 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 2093 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 2094 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 2095 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 2096 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 2097 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 2098 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 2099 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 2100 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 2101 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 2102 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 2103 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 2104 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 2105 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 2106 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 2107 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 2108 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 2109 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 2110 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 2111 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 2112 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 2113 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 2114 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 2115 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 2116 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 2117 * 2118 * PEM_PARSE uses AES for decrypting encrypted keys. 2119 */ 2120 #define MBEDTLS_AES_C 2121 2122 /** 2123 * \def MBEDTLS_ASN1_PARSE_C 2124 * 2125 * Enable the generic ASN1 parser. 2126 * 2127 * Module: library/asn1.c 2128 * Caller: library/x509.c 2129 * library/dhm.c 2130 * library/pkcs12.c 2131 * library/pkcs5.c 2132 * library/pkparse.c 2133 */ 2134 #define MBEDTLS_ASN1_PARSE_C 2135 2136 /** 2137 * \def MBEDTLS_ASN1_WRITE_C 2138 * 2139 * Enable the generic ASN1 writer. 2140 * 2141 * Module: library/asn1write.c 2142 * Caller: library/ecdsa.c 2143 * library/pkwrite.c 2144 * library/x509_create.c 2145 * library/x509write_crt.c 2146 * library/x509write_csr.c 2147 */ 2148 #define MBEDTLS_ASN1_WRITE_C 2149 2150 /** 2151 * \def MBEDTLS_BASE64_C 2152 * 2153 * Enable the Base64 module. 2154 * 2155 * Module: library/base64.c 2156 * Caller: library/pem.c 2157 * 2158 * This module is required for PEM support (required by X.509). 2159 */ 2160 #define MBEDTLS_BASE64_C 2161 2162 /** 2163 * \def MBEDTLS_BIGNUM_C 2164 * 2165 * Enable the multi-precision integer library. 2166 * 2167 * Module: library/bignum.c 2168 * library/bignum_core.c 2169 * library/bignum_mod.c 2170 * library/bignum_mod_raw.c 2171 * Caller: library/dhm.c 2172 * library/ecp.c 2173 * library/ecdsa.c 2174 * library/rsa.c 2175 * library/rsa_alt_helpers.c 2176 * library/ssl_tls.c 2177 * 2178 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. 2179 */ 2180 #define MBEDTLS_BIGNUM_C 2181 2182 /** 2183 * \def MBEDTLS_CAMELLIA_C 2184 * 2185 * Enable the Camellia block cipher. 2186 * 2187 * Module: library/camellia.c 2188 * Caller: library/cipher.c 2189 * 2190 * This module enables the following ciphersuites (if other requisites are 2191 * enabled as well): 2192 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 2193 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 2194 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 2195 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 2196 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 2197 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 2198 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 2199 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 2200 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 2201 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 2202 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 2203 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 2204 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 2205 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 2206 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 2207 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 2208 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 2209 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 2210 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 2211 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 2212 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 2213 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 2214 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 2215 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 2216 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 2217 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 2218 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 2219 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 2220 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 2221 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 2222 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 2223 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 2224 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 2225 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 2226 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 2227 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 2228 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 2229 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 2230 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 2231 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 2232 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 2233 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 2234 */ 2235 #define MBEDTLS_CAMELLIA_C 2236 2237 /** 2238 * \def MBEDTLS_ARIA_C 2239 * 2240 * Enable the ARIA block cipher. 2241 * 2242 * Module: library/aria.c 2243 * Caller: library/cipher.c 2244 * 2245 * This module enables the following ciphersuites (if other requisites are 2246 * enabled as well): 2247 * 2248 * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 2249 * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 2250 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 2251 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 2252 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 2253 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 2254 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 2255 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 2256 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 2257 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 2258 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 2259 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 2260 * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 2261 * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 2262 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 2263 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 2264 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 2265 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 2266 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 2267 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 2268 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 2269 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 2270 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 2271 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 2272 * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 2273 * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 2274 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 2275 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 2276 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 2277 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 2278 * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 2279 * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 2280 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 2281 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 2282 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 2283 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 2284 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 2285 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 2286 */ 2287 #define MBEDTLS_ARIA_C 2288 2289 /** 2290 * \def MBEDTLS_CCM_C 2291 * 2292 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher. 2293 * 2294 * Module: library/ccm.c 2295 * 2296 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or 2297 * MBEDTLS_ARIA_C 2298 * 2299 * This module enables the AES-CCM ciphersuites, if other requisites are 2300 * enabled as well. 2301 */ 2302 #define MBEDTLS_CCM_C 2303 2304 /** 2305 * \def MBEDTLS_CHACHA20_C 2306 * 2307 * Enable the ChaCha20 stream cipher. 2308 * 2309 * Module: library/chacha20.c 2310 */ 2311 #define MBEDTLS_CHACHA20_C 2312 2313 /** 2314 * \def MBEDTLS_CHACHAPOLY_C 2315 * 2316 * Enable the ChaCha20-Poly1305 AEAD algorithm. 2317 * 2318 * Module: library/chachapoly.c 2319 * 2320 * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C 2321 */ 2322 #define MBEDTLS_CHACHAPOLY_C 2323 2324 /** 2325 * \def MBEDTLS_CIPHER_C 2326 * 2327 * Enable the generic cipher layer. 2328 * 2329 * Module: library/cipher.c 2330 * Caller: library/ccm.c 2331 * library/cmac.c 2332 * library/gcm.c 2333 * library/nist_kw.c 2334 * library/pkcs12.c 2335 * library/pkcs5.c 2336 * library/psa_crypto_aead.c 2337 * library/psa_crypto_mac.c 2338 * library/ssl_ciphersuites.c 2339 * library/ssl_msg.c 2340 * library/ssl_ticket.c (unless MBEDTLS_USE_PSA_CRYPTO is enabled) 2341 * 2342 * Uncomment to enable generic cipher wrappers. 2343 */ 2344 #define MBEDTLS_CIPHER_C 2345 2346 /** 2347 * \def MBEDTLS_CMAC_C 2348 * 2349 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block 2350 * ciphers. 2351 * 2352 * \note When #MBEDTLS_CMAC_ALT is active, meaning that the underlying 2353 * implementation of the CMAC algorithm is provided by an alternate 2354 * implementation, that alternate implementation may opt to not support 2355 * AES-192 or 3DES as underlying block ciphers for the CMAC operation. 2356 * 2357 * Module: library/cmac.c 2358 * 2359 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_DES_C 2360 * 2361 */ 2362 #define MBEDTLS_CMAC_C 2363 2364 /** 2365 * \def MBEDTLS_CTR_DRBG_C 2366 * 2367 * Enable the CTR_DRBG AES-based random generator. 2368 * The CTR_DRBG generator uses AES-256 by default. 2369 * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above. 2370 * 2371 * \note To achieve a 256-bit security strength with CTR_DRBG, 2372 * you must use AES-256 *and* use sufficient entropy. 2373 * See ctr_drbg.h for more details. 2374 * 2375 * Module: library/ctr_drbg.c 2376 * Caller: 2377 * 2378 * Requires: MBEDTLS_AES_C 2379 * 2380 * This module provides the CTR_DRBG AES random number generator. 2381 */ 2382 #define MBEDTLS_CTR_DRBG_C 2383 2384 /** 2385 * \def MBEDTLS_DEBUG_C 2386 * 2387 * Enable the debug functions. 2388 * 2389 * Module: library/debug.c 2390 * Caller: library/ssl_msg.c 2391 * library/ssl_tls.c 2392 * library/ssl_tls12_*.c 2393 * library/ssl_tls13_*.c 2394 * 2395 * This module provides debugging functions. 2396 */ 2397 #define MBEDTLS_DEBUG_C 2398 2399 /** 2400 * \def MBEDTLS_DES_C 2401 * 2402 * Enable the DES block cipher. 2403 * 2404 * Module: library/des.c 2405 * Caller: library/pem.c 2406 * library/cipher.c 2407 * 2408 * PEM_PARSE uses DES/3DES for decrypting encrypted keys. 2409 * 2410 * \warning DES is considered a weak cipher and its use constitutes a 2411 * security risk. We recommend considering stronger ciphers instead. 2412 */ 2413 #define MBEDTLS_DES_C 2414 2415 /** 2416 * \def MBEDTLS_DHM_C 2417 * 2418 * Enable the Diffie-Hellman-Merkle module. 2419 * 2420 * Module: library/dhm.c 2421 * Caller: library/ssl_tls.c 2422 * library/ssl*_client.c 2423 * library/ssl*_server.c 2424 * 2425 * This module is used by the following key exchanges: 2426 * DHE-RSA, DHE-PSK 2427 * 2428 * \warning Using DHE constitutes a security risk as it 2429 * is not possible to validate custom DH parameters. 2430 * If possible, it is recommended users should consider 2431 * preferring other methods of key exchange. 2432 * See dhm.h for more details. 2433 * 2434 */ 2435 #define MBEDTLS_DHM_C 2436 2437 /** 2438 * \def MBEDTLS_ECDH_C 2439 * 2440 * Enable the elliptic curve Diffie-Hellman library. 2441 * 2442 * Module: library/ecdh.c 2443 * Caller: library/psa_crypto.c 2444 * library/ssl_tls.c 2445 * library/ssl*_client.c 2446 * library/ssl*_server.c 2447 * 2448 * This module is used by the following key exchanges: 2449 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK 2450 * 2451 * Requires: MBEDTLS_ECP_C 2452 */ 2453 #define MBEDTLS_ECDH_C 2454 2455 /** 2456 * \def MBEDTLS_ECDSA_C 2457 * 2458 * Enable the elliptic curve DSA library. 2459 * 2460 * Module: library/ecdsa.c 2461 * Caller: 2462 * 2463 * This module is used by the following key exchanges: 2464 * ECDHE-ECDSA 2465 * 2466 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C, 2467 * and at least one MBEDTLS_ECP_DP_XXX_ENABLED for a 2468 * short Weierstrass curve. 2469 */ 2470 #define MBEDTLS_ECDSA_C 2471 2472 /** 2473 * \def MBEDTLS_ECJPAKE_C 2474 * 2475 * Enable the elliptic curve J-PAKE library. 2476 * 2477 * \note EC J-PAKE support is based on the Thread v1.0.0 specification. 2478 * It has not been reviewed for compliance with newer standards such as 2479 * Thread v1.1 or RFC 8236. 2480 * 2481 * Module: library/ecjpake.c 2482 * Caller: 2483 * 2484 * This module is used by the following key exchanges: 2485 * ECJPAKE 2486 * 2487 * Requires: MBEDTLS_ECP_C and either MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C 2488 * 2489 * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() 2490 * before doing any EC J-PAKE operations. 2491 * 2492 * \warning When building with MBEDTLS_MD_C, all hashes used with this 2493 * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, 2494 * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by 2495 * this module in builds where MBEDTLS_MD_C is disabled. 2496 */ 2497 #define MBEDTLS_ECJPAKE_C 2498 2499 /** 2500 * \def MBEDTLS_ECP_C 2501 * 2502 * Enable the elliptic curve over GF(p) library. 2503 * 2504 * Module: library/ecp.c 2505 * Caller: library/ecdh.c 2506 * library/ecdsa.c 2507 * library/ecjpake.c 2508 * 2509 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED 2510 */ 2511 #define MBEDTLS_ECP_C 2512 2513 /** 2514 * \def MBEDTLS_ENTROPY_C 2515 * 2516 * Enable the platform-specific entropy code. 2517 * 2518 * Module: library/entropy.c 2519 * Caller: 2520 * 2521 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C 2522 * 2523 * This module provides a generic entropy pool 2524 */ 2525 #define MBEDTLS_ENTROPY_C 2526 2527 /** 2528 * \def MBEDTLS_ERROR_C 2529 * 2530 * Enable error code to error string conversion. 2531 * 2532 * Module: library/error.c 2533 * Caller: 2534 * 2535 * This module enables mbedtls_strerror(). 2536 */ 2537 #define MBEDTLS_ERROR_C 2538 2539 /** 2540 * \def MBEDTLS_GCM_C 2541 * 2542 * Enable the Galois/Counter Mode (GCM). 2543 * 2544 * Module: library/gcm.c 2545 * 2546 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or 2547 * MBEDTLS_ARIA_C 2548 * 2549 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other 2550 * requisites are enabled as well. 2551 */ 2552 #define MBEDTLS_GCM_C 2553 2554 /** 2555 * \def MBEDTLS_HKDF_C 2556 * 2557 * Enable the HKDF algorithm (RFC 5869). 2558 * 2559 * Module: library/hkdf.c 2560 * Caller: 2561 * 2562 * Requires: MBEDTLS_MD_C 2563 * 2564 * This module adds support for the Hashed Message Authentication Code 2565 * (HMAC)-based key derivation function (HKDF). 2566 */ 2567 #define MBEDTLS_HKDF_C 2568 2569 /** 2570 * \def MBEDTLS_HMAC_DRBG_C 2571 * 2572 * Enable the HMAC_DRBG random generator. 2573 * 2574 * Module: library/hmac_drbg.c 2575 * Caller: 2576 * 2577 * Requires: MBEDTLS_MD_C 2578 * 2579 * Uncomment to enable the HMAC_DRBG random number generator. 2580 */ 2581 #define MBEDTLS_HMAC_DRBG_C 2582 2583 /** 2584 * \def MBEDTLS_LMS_C 2585 * 2586 * Enable the LMS stateful-hash asymmetric signature algorithm. 2587 * 2588 * Module: library/lms.c 2589 * Caller: 2590 * 2591 * Requires: MBEDTLS_PSA_CRYPTO_C 2592 * 2593 * Uncomment to enable the LMS verification algorithm and public key operations. 2594 */ 2595 #define MBEDTLS_LMS_C 2596 2597 /** 2598 * \def MBEDTLS_LMS_PRIVATE 2599 * 2600 * Enable LMS private-key operations and signing code. Functions enabled by this 2601 * option are experimental, and should not be used in production. 2602 * 2603 * Requires: MBEDTLS_LMS_C 2604 * 2605 * Uncomment to enable the LMS signature algorithm and private key operations. 2606 */ 2607 //#define MBEDTLS_LMS_PRIVATE 2608 2609 /** 2610 * \def MBEDTLS_NIST_KW_C 2611 * 2612 * Enable the Key Wrapping mode for 128-bit block ciphers, 2613 * as defined in NIST SP 800-38F. Only KW and KWP modes 2614 * are supported. At the moment, only AES is approved by NIST. 2615 * 2616 * Module: library/nist_kw.c 2617 * 2618 * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C 2619 */ 2620 #define MBEDTLS_NIST_KW_C 2621 2622 /** 2623 * \def MBEDTLS_MD_C 2624 * 2625 * Enable the generic message digest layer. 2626 * 2627 * Requires: one of: MBEDTLS_MD5_C, MBEDTLS_RIPEMD160_C, MBEDTLS_SHA1_C, 2628 * MBEDTLS_SHA224_C, MBEDTLS_SHA256_C, MBEDTLS_SHA384_C, 2629 * MBEDTLS_SHA512_C. 2630 * Module: library/md.c 2631 * Caller: library/constant_time.c 2632 * library/ecdsa.c 2633 * library/ecjpake.c 2634 * library/hkdf.c 2635 * library/hmac_drbg.c 2636 * library/pk.c 2637 * library/pkcs5.c 2638 * library/pkcs12.c 2639 * library/psa_crypto_ecp.c 2640 * library/psa_crypto_rsa.c 2641 * library/rsa.c 2642 * library/ssl_cookie.c 2643 * library/ssl_msg.c 2644 * library/ssl_tls.c 2645 * library/x509.c 2646 * library/x509_crt.c 2647 * library/x509write_crt.c 2648 * library/x509write_csr.c 2649 * 2650 * Uncomment to enable generic message digest wrappers. 2651 */ 2652 #define MBEDTLS_MD_C 2653 2654 /** 2655 * \def MBEDTLS_MD5_C 2656 * 2657 * Enable the MD5 hash algorithm. 2658 * 2659 * Module: library/md5.c 2660 * Caller: library/md.c 2661 * library/pem.c 2662 * library/ssl_tls.c 2663 * 2664 * This module is required for TLS 1.2 depending on the handshake parameters. 2665 * Further, it is used for checking MD5-signed certificates, and for PBKDF1 2666 * when decrypting PEM-encoded encrypted keys. 2667 * 2668 * \warning MD5 is considered a weak message digest and its use constitutes a 2669 * security risk. If possible, we recommend avoiding dependencies on 2670 * it, and considering stronger message digests instead. 2671 * 2672 */ 2673 #define MBEDTLS_MD5_C 2674 2675 /** 2676 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C 2677 * 2678 * Enable the buffer allocator implementation that makes use of a (stack) 2679 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free() 2680 * calls) 2681 * 2682 * Module: library/memory_buffer_alloc.c 2683 * 2684 * Requires: MBEDTLS_PLATFORM_C 2685 * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS) 2686 * 2687 * Enable this module to enable the buffer memory allocator. 2688 */ 2689 //#define MBEDTLS_MEMORY_BUFFER_ALLOC_C 2690 2691 /** 2692 * \def MBEDTLS_NET_C 2693 * 2694 * Enable the TCP and UDP over IPv6/IPv4 networking routines. 2695 * 2696 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X) 2697 * and Windows. For other platforms, you'll want to disable it, and write your 2698 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio(). 2699 * 2700 * \note See also our Knowledge Base article about porting to a new 2701 * environment: 2702 * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS 2703 * 2704 * Module: library/net_sockets.c 2705 * 2706 * This module provides networking routines. 2707 */ 2708 #define MBEDTLS_NET_C 2709 2710 /** 2711 * \def MBEDTLS_OID_C 2712 * 2713 * Enable the OID database. 2714 * 2715 * Module: library/oid.c 2716 * Caller: library/asn1write.c 2717 * library/pkcs5.c 2718 * library/pkparse.c 2719 * library/pkwrite.c 2720 * library/rsa.c 2721 * library/x509.c 2722 * library/x509_create.c 2723 * library/x509_crl.c 2724 * library/x509_crt.c 2725 * library/x509_csr.c 2726 * library/x509write_crt.c 2727 * library/x509write_csr.c 2728 * 2729 * This modules translates between OIDs and internal values. 2730 */ 2731 #define MBEDTLS_OID_C 2732 2733 /** 2734 * \def MBEDTLS_PADLOCK_C 2735 * 2736 * Enable VIA Padlock support on x86. 2737 * 2738 * Module: library/padlock.c 2739 * Caller: library/aes.c 2740 * 2741 * Requires: MBEDTLS_HAVE_ASM 2742 * 2743 * This modules adds support for the VIA PadLock on x86. 2744 */ 2745 #define MBEDTLS_PADLOCK_C 2746 2747 /** 2748 * \def MBEDTLS_PEM_PARSE_C 2749 * 2750 * Enable PEM decoding / parsing. 2751 * 2752 * Module: library/pem.c 2753 * Caller: library/dhm.c 2754 * library/pkparse.c 2755 * library/x509_crl.c 2756 * library/x509_crt.c 2757 * library/x509_csr.c 2758 * 2759 * Requires: MBEDTLS_BASE64_C 2760 * 2761 * This modules adds support for decoding / parsing PEM files. 2762 */ 2763 #define MBEDTLS_PEM_PARSE_C 2764 2765 /** 2766 * \def MBEDTLS_PEM_WRITE_C 2767 * 2768 * Enable PEM encoding / writing. 2769 * 2770 * Module: library/pem.c 2771 * Caller: library/pkwrite.c 2772 * library/x509write_crt.c 2773 * library/x509write_csr.c 2774 * 2775 * Requires: MBEDTLS_BASE64_C 2776 * 2777 * This modules adds support for encoding / writing PEM files. 2778 */ 2779 #define MBEDTLS_PEM_WRITE_C 2780 2781 /** 2782 * \def MBEDTLS_PK_C 2783 * 2784 * Enable the generic public (asymmetric) key layer. 2785 * 2786 * Module: library/pk.c 2787 * Caller: library/psa_crypto_rsa.c 2788 * library/ssl_tls.c 2789 * library/ssl*_client.c 2790 * library/ssl*_server.c 2791 * library/x509.c 2792 * 2793 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C or MBEDTLS_ECP_C 2794 * 2795 * Uncomment to enable generic public key wrappers. 2796 */ 2797 #define MBEDTLS_PK_C 2798 2799 /** 2800 * \def MBEDTLS_PK_PARSE_C 2801 * 2802 * Enable the generic public (asymmetric) key parser. 2803 * 2804 * Module: library/pkparse.c 2805 * Caller: library/x509_crt.c 2806 * library/x509_csr.c 2807 * 2808 * Requires: MBEDTLS_PK_C 2809 * 2810 * Uncomment to enable generic public key parse functions. 2811 */ 2812 #define MBEDTLS_PK_PARSE_C 2813 2814 /** 2815 * \def MBEDTLS_PK_WRITE_C 2816 * 2817 * Enable the generic public (asymmetric) key writer. 2818 * 2819 * Module: library/pkwrite.c 2820 * Caller: library/x509write.c 2821 * 2822 * Requires: MBEDTLS_PK_C 2823 * 2824 * Uncomment to enable generic public key write functions. 2825 */ 2826 #define MBEDTLS_PK_WRITE_C 2827 2828 /** 2829 * \def MBEDTLS_PKCS5_C 2830 * 2831 * Enable PKCS#5 functions. 2832 * 2833 * Module: library/pkcs5.c 2834 * 2835 * Requires: MBEDTLS_CIPHER_C and either MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C. 2836 * 2837 * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() 2838 * before doing any PKCS5 operation. 2839 * 2840 * \warning When building with MBEDTLS_MD_C, all hashes used with this 2841 * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, 2842 * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by 2843 * this module in builds where MBEDTLS_MD_C is disabled. 2844 * 2845 * This module adds support for the PKCS#5 functions. 2846 */ 2847 #define MBEDTLS_PKCS5_C 2848 2849 /** 2850 * \def MBEDTLS_PKCS7_C 2851 * 2852 * This feature is a work in progress and not ready for production. Testing and 2853 * validation is incomplete, and handling of malformed inputs may not be robust. 2854 * The API may change. 2855 * 2856 * Enable PKCS7 core for using PKCS7 formatted signatures. 2857 * RFC Link - https://tools.ietf.org/html/rfc2315 2858 * 2859 * Module: library/pkcs7.c 2860 * 2861 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C, 2862 * MBEDTLS_X509_CRT_PARSE_C MBEDTLS_X509_CRL_PARSE_C, 2863 * MBEDTLS_BIGNUM_C, MBEDTLS_MD_C 2864 * 2865 * This module is required for the PKCS7 parsing modules. 2866 */ 2867 //#define MBEDTLS_PKCS7_C 2868 2869 /** 2870 * \def MBEDTLS_PKCS12_C 2871 * 2872 * Enable PKCS#12 PBE functions. 2873 * Adds algorithms for parsing PKCS#8 encrypted private keys 2874 * 2875 * Module: library/pkcs12.c 2876 * Caller: library/pkparse.c 2877 * 2878 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C and either 2879 * MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C. 2880 * 2881 * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() 2882 * before doing any PKCS12 operation. 2883 * 2884 * \warning When building with MBEDTLS_MD_C, all hashes used with this 2885 * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, 2886 * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by 2887 * this module in builds where MBEDTLS_MD_C is disabled. 2888 * 2889 * This module enables PKCS#12 functions. 2890 */ 2891 #define MBEDTLS_PKCS12_C 2892 2893 /** 2894 * \def MBEDTLS_PLATFORM_C 2895 * 2896 * Enable the platform abstraction layer that allows you to re-assign 2897 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). 2898 * 2899 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT 2900 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned 2901 * above to be specified at runtime or compile time respectively. 2902 * 2903 * \note This abstraction layer must be enabled on Windows (including MSYS2) 2904 * as other modules rely on it for a fixed snprintf implementation. 2905 * 2906 * Module: library/platform.c 2907 * Caller: Most other .c files 2908 * 2909 * This module enables abstraction of common (libc) functions. 2910 */ 2911 #define MBEDTLS_PLATFORM_C 2912 2913 /** 2914 * \def MBEDTLS_POLY1305_C 2915 * 2916 * Enable the Poly1305 MAC algorithm. 2917 * 2918 * Module: library/poly1305.c 2919 * Caller: library/chachapoly.c 2920 */ 2921 #define MBEDTLS_POLY1305_C 2922 2923 /** 2924 * \def MBEDTLS_PSA_CRYPTO_C 2925 * 2926 * Enable the Platform Security Architecture cryptography API. 2927 * 2928 * Module: library/psa_crypto.c 2929 * 2930 * Requires: MBEDTLS_CIPHER_C, 2931 * either MBEDTLS_CTR_DRBG_C and MBEDTLS_ENTROPY_C, 2932 * or MBEDTLS_HMAC_DRBG_C and MBEDTLS_ENTROPY_C, 2933 * or MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG. 2934 * 2935 */ 2936 #define MBEDTLS_PSA_CRYPTO_C 2937 2938 /** 2939 * \def MBEDTLS_PSA_CRYPTO_SE_C 2940 * 2941 * Enable dynamic secure element support in the Platform Security Architecture 2942 * cryptography API. 2943 * 2944 * \deprecated This feature is deprecated. Please switch to the driver 2945 * interface enabled by #MBEDTLS_PSA_CRYPTO_DRIVERS. 2946 * 2947 * Module: library/psa_crypto_se.c 2948 * 2949 * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_CRYPTO_STORAGE_C 2950 * 2951 */ 2952 //#define MBEDTLS_PSA_CRYPTO_SE_C 2953 2954 /** 2955 * \def MBEDTLS_PSA_CRYPTO_STORAGE_C 2956 * 2957 * Enable the Platform Security Architecture persistent key storage. 2958 * 2959 * Module: library/psa_crypto_storage.c 2960 * 2961 * Requires: MBEDTLS_PSA_CRYPTO_C, 2962 * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of 2963 * the PSA ITS interface 2964 */ 2965 #define MBEDTLS_PSA_CRYPTO_STORAGE_C 2966 2967 /** 2968 * \def MBEDTLS_PSA_ITS_FILE_C 2969 * 2970 * Enable the emulation of the Platform Security Architecture 2971 * Internal Trusted Storage (PSA ITS) over files. 2972 * 2973 * Module: library/psa_its_file.c 2974 * 2975 * Requires: MBEDTLS_FS_IO 2976 */ 2977 #define MBEDTLS_PSA_ITS_FILE_C 2978 2979 /** 2980 * \def MBEDTLS_RIPEMD160_C 2981 * 2982 * Enable the RIPEMD-160 hash algorithm. 2983 * 2984 * Module: library/ripemd160.c 2985 * Caller: library/md.c 2986 * 2987 */ 2988 #define MBEDTLS_RIPEMD160_C 2989 2990 /** 2991 * \def MBEDTLS_RSA_C 2992 * 2993 * Enable the RSA public-key cryptosystem. 2994 * 2995 * Module: library/rsa.c 2996 * library/rsa_alt_helpers.c 2997 * Caller: library/pk.c 2998 * library/psa_crypto.c 2999 * library/ssl_tls.c 3000 * library/ssl*_client.c 3001 * library/ssl*_server.c 3002 * 3003 * This module is used by the following key exchanges: 3004 * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK 3005 * 3006 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C 3007 */ 3008 #define MBEDTLS_RSA_C 3009 3010 /** 3011 * \def MBEDTLS_SHA1_C 3012 * 3013 * Enable the SHA1 cryptographic hash algorithm. 3014 * 3015 * Module: library/sha1.c 3016 * Caller: library/md.c 3017 * library/psa_crypto_hash.c 3018 * 3019 * This module is required for TLS 1.2 depending on the handshake parameters, 3020 * and for SHA1-signed certificates. 3021 * 3022 * \warning SHA-1 is considered a weak message digest and its use constitutes 3023 * a security risk. If possible, we recommend avoiding dependencies 3024 * on it, and considering stronger message digests instead. 3025 * 3026 */ 3027 #define MBEDTLS_SHA1_C 3028 3029 /** 3030 * \def MBEDTLS_SHA224_C 3031 * 3032 * Enable the SHA-224 cryptographic hash algorithm. 3033 * 3034 * Requires: MBEDTLS_SHA256_C. The library does not currently support enabling 3035 * SHA-224 without SHA-256. 3036 * 3037 * Module: library/sha256.c 3038 * Caller: library/md.c 3039 * library/ssl_cookie.c 3040 * 3041 * This module adds support for SHA-224. 3042 */ 3043 #define MBEDTLS_SHA224_C 3044 3045 /** 3046 * \def MBEDTLS_SHA256_C 3047 * 3048 * Enable the SHA-256 cryptographic hash algorithm. 3049 * 3050 * Requires: MBEDTLS_SHA224_C. The library does not currently support enabling 3051 * SHA-256 without SHA-224. 3052 * 3053 * Module: library/sha256.c 3054 * Caller: library/entropy.c 3055 * library/md.c 3056 * library/ssl_tls.c 3057 * library/ssl*_client.c 3058 * library/ssl*_server.c 3059 * 3060 * This module adds support for SHA-256. 3061 * This module is required for the SSL/TLS 1.2 PRF function. 3062 */ 3063 #define MBEDTLS_SHA256_C 3064 #define MBEDTLS_SHA384_C 3065 #define MBEDTLS_SHA512_C 3066 #define MBEDTLS_SSL_CACHE_C 3067 #define MBEDTLS_SSL_COOKIE_C 3068 #define MBEDTLS_SSL_TICKET_C 3069 #define MBEDTLS_SSL_CLI_C 3070 #define MBEDTLS_SSL_SRV_C 3071 #define MBEDTLS_SSL_TLS_C 3072 #define MBEDTLS_TIMING_C 3073 #define MBEDTLS_VERSION_C 3074 #define MBEDTLS_X509_USE_C 3075 #define MBEDTLS_X509_CRT_PARSE_C 3076 #define MBEDTLS_X509_CRL_PARSE_C 3077 #define MBEDTLS_X509_CSR_PARSE_C 3078 #define MBEDTLS_X509_CREATE_C 3079 #define MBEDTLS_X509_CRT_WRITE_C 3080 #define MBEDTLS_X509_CSR_WRITE_C 3081