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 | 16799db | 2023-11-02 19:47:20 +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 | * |
Ryan Everett | 885ea8d | 2024-04-24 16:34:14 +0100 | [diff] [blame^] | 20 | * To be used in conjunction with configs/crypto-config-thread.h. |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 21 | * See README.txt for usage instructions. |
| 22 | */ |
| 23 | |
Ryan Everett | 885ea8d | 2024-04-24 16:34:14 +0100 | [diff] [blame^] | 24 | #define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "../configs/crypto-config-thread.h" |
| 25 | |
| 26 | #define MBEDTLS_PSA_CRYPTO_CONFIG |
| 27 | |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 28 | /* System support */ |
| 29 | #define MBEDTLS_HAVE_ASM |
| 30 | |
Gilles Peskine | e820c0a | 2023-08-03 17:45:20 +0200 | [diff] [blame] | 31 | /* Mbed TLS feature support */ |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 32 | #define MBEDTLS_AES_ROM_TABLES |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 33 | #define MBEDTLS_ECP_NIST_OPTIM |
| 34 | #define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 35 | #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 36 | #define MBEDTLS_SSL_PROTO_TLS1_2 |
| 37 | #define MBEDTLS_SSL_PROTO_DTLS |
| 38 | #define MBEDTLS_SSL_DTLS_ANTI_REPLAY |
| 39 | #define MBEDTLS_SSL_DTLS_HELLO_VERIFY |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 40 | |
Gilles Peskine | e820c0a | 2023-08-03 17:45:20 +0200 | [diff] [blame] | 41 | /* Mbed TLS modules */ |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 42 | #define MBEDTLS_ASN1_PARSE_C |
| 43 | #define MBEDTLS_ASN1_WRITE_C |
| 44 | #define MBEDTLS_BIGNUM_C |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 45 | #define MBEDTLS_CIPHER_C |
| 46 | #define MBEDTLS_CTR_DRBG_C |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 47 | #define MBEDTLS_ENTROPY_C |
| 48 | #define MBEDTLS_HMAC_DRBG_C |
| 49 | #define MBEDTLS_MD_C |
| 50 | #define MBEDTLS_OID_C |
| 51 | #define MBEDTLS_PK_C |
| 52 | #define MBEDTLS_PK_PARSE_C |
Manuel Pégourié-Gonnard | 9f52cac | 2015-10-19 14:06:07 +0200 | [diff] [blame] | 53 | #define MBEDTLS_SSL_COOKIE_C |
| 54 | #define MBEDTLS_SSL_CLI_C |
| 55 | #define MBEDTLS_SSL_SRV_C |
| 56 | #define MBEDTLS_SSL_TLS_C |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 57 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 58 | /* For tests using ssl-opt.sh */ |
| 59 | #define MBEDTLS_NET_C |
| 60 | #define MBEDTLS_TIMING_C |
| 61 | |
Manuel Pégourié-Gonnard | 3e5b5f1 | 2015-10-20 14:55:13 +0200 | [diff] [blame] | 62 | /* Save RAM at the expense of ROM */ |
| 63 | #define MBEDTLS_AES_ROM_TABLES |
| 64 | |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 65 | /* Save RAM by adjusting to our exact needs */ |
Gilles Peskine | d0b1630 | 2021-05-28 00:17:26 +0200 | [diff] [blame] | 66 | #define MBEDTLS_MPI_MAX_SIZE 32 // 256-bit EC curve = 32 bytes |
Manuel Pégourié-Gonnard | b6fe70b | 2015-10-19 15:56:43 +0200 | [diff] [blame] | 67 | |
| 68 | /* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */ |
| 69 | #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 |
Andrzej Kurek | 01005b9 | 2022-01-17 15:32:02 +0100 | [diff] [blame] | 70 | |
| 71 | /* These defines are present so that the config modifying scripts can enable |
| 72 | * them during tests/scripts/test-ref-configs.pl */ |
| 73 | //#define MBEDTLS_USE_PSA_CRYPTO |
| 74 | //#define MBEDTLS_PSA_CRYPTO_C |