Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 1 | /** |
| 2 | * \file config-thread.h |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 3 | * |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 4 | * \brief Minimal configuration for using TLS as part of Thread |
| 5 | */ |
| 6 | /* |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 7 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 7ff7965 | 2023-11-03 12:04:52 +0000 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | /* |
| 12 | * Minimal configuration for using TLS a part of Thread |
| 13 | * http://threadgroup.org/ |
| 14 | * |
| 15 | * Distinguishing features: |
| 16 | * - no RSA or classic DH, fully based on ECC |
| 17 | * - no X.509 |
| 18 | * - support for experimental EC J-PAKE key exchange |
| 19 | * |
| 20 | * See README.txt for usage instructions. |
| 21 | */ |
| 22 | |
| 23 | #ifndef MBEDTLS_CONFIG_H |
| 24 | #define MBEDTLS_CONFIG_H |
| 25 | |
| 26 | /* System support */ |
| 27 | #define MBEDTLS_HAVE_ASM |
| 28 | |
Gilles Peskine | f08ca83 | 2023-09-12 19:21:54 +0200 | [diff] [blame] | 29 | /* Mbed TLS feature support */ |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 30 | #define MBEDTLS_AES_ROM_TABLES |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 31 | #define MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 32 | #define MBEDTLS_ECP_NIST_OPTIM |
| 33 | #define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 34 | #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 35 | #define MBEDTLS_SSL_PROTO_TLS1_2 |
| 36 | #define MBEDTLS_SSL_PROTO_DTLS |
| 37 | #define MBEDTLS_SSL_DTLS_ANTI_REPLAY |
| 38 | #define MBEDTLS_SSL_DTLS_HELLO_VERIFY |
| 39 | #define MBEDTLS_SSL_EXPORT_KEYS |
| 40 | |
Gilles Peskine | f08ca83 | 2023-09-12 19:21:54 +0200 | [diff] [blame] | 41 | /* Mbed TLS modules */ |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 42 | #define MBEDTLS_AES_C |
| 43 | #define MBEDTLS_ASN1_PARSE_C |
| 44 | #define MBEDTLS_ASN1_WRITE_C |
| 45 | #define MBEDTLS_BIGNUM_C |
| 46 | #define MBEDTLS_CCM_C |
| 47 | #define MBEDTLS_CIPHER_C |
| 48 | #define MBEDTLS_CTR_DRBG_C |
Brian Murray | 8b4111c | 2016-09-13 15:58:46 -0700 | [diff] [blame] | 49 | #define MBEDTLS_CMAC_C |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 50 | #define MBEDTLS_ECJPAKE_C |
| 51 | #define MBEDTLS_ECP_C |
| 52 | #define MBEDTLS_ENTROPY_C |
| 53 | #define MBEDTLS_HMAC_DRBG_C |
| 54 | #define MBEDTLS_MD_C |
| 55 | #define MBEDTLS_OID_C |
| 56 | #define MBEDTLS_PK_C |
| 57 | #define MBEDTLS_PK_PARSE_C |
| 58 | #define MBEDTLS_SHA256_C |
| 59 | #define MBEDTLS_SSL_COOKIE_C |
| 60 | #define MBEDTLS_SSL_CLI_C |
| 61 | #define MBEDTLS_SSL_SRV_C |
| 62 | #define MBEDTLS_SSL_TLS_C |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 63 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 64 | /* For tests using ssl-opt.sh */ |
| 65 | #define MBEDTLS_NET_C |
| 66 | #define MBEDTLS_TIMING_C |
| 67 | |
Manuel Pégourié-Gonnard | 3e5b5f1 | 2015-10-20 14:55:13 +0200 | [diff] [blame] | 68 | /* Save RAM at the expense of ROM */ |
| 69 | #define MBEDTLS_AES_ROM_TABLES |
| 70 | |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 71 | /* Save RAM by adjusting to our exact needs */ |
Gilles Peskine | 33c92f0 | 2021-06-02 23:34:02 +0200 | [diff] [blame] | 72 | #define MBEDTLS_MPI_MAX_SIZE 32 // 32 bytes for a 256-bit elliptic curve |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 73 | |
| 74 | /* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */ |
| 75 | #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 76 | |
Andrzej Kurek | 19e83fa | 2022-01-17 16:05:43 +0100 | [diff] [blame] | 77 | /* These defines are present so that the config modifying scripts can enable |
| 78 | * them during tests/scripts/test-ref-configs.pl */ |
| 79 | //#define MBEDTLS_USE_PSA_CRYPTO |
| 80 | //#define MBEDTLS_PSA_CRYPTO_C |
| 81 | |
Manuel Pégourié-Gonnard | 3e5b5f1 | 2015-10-20 14:55:13 +0200 | [diff] [blame] | 82 | #include "mbedtls/check_config.h" |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 83 | |
| 84 | #endif /* MBEDTLS_CONFIG_H */ |