blob: 77c0b1772f99e2a6f74f803fb35430243f4782c5 [file] [log] [blame]
Darryl Greena40a1012018-01-05 15:33:17 +00001/**
2 * \file config-suite-b.h
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +02003 *
Darryl Greena40a1012018-01-05 15:33:17 +00004 * \brief Minimal configuration for TLS NSA Suite B Profile (RFC 6460)
5 */
6/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02007 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00008 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +02009 */
10/*
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020011 * Minimal configuration for TLS NSA Suite B Profile (RFC 6460)
12 *
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020013 * Distinguishing features:
14 * - no RSA or classic DH, fully based on ECC
15 * - optimized for low RAM usage
16 *
17 * Possible improvements:
18 * - if 128-bit security is enough, disable secp384r1 and SHA-512
19 * - use embedded certs in DER format and disable PEM_PARSE_C and BASE64_C
20 *
Manuel Pégourié-Gonnard0bc1f232014-04-30 11:53:50 +020021 * See README.txt for usage instructions.
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020022 */
23
Ryan Everett44d7ddf2024-04-26 11:25:43 +010024#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "../configs/crypto-config-suite-b.h"
25
26#define MBEDTLS_PSA_CRYPTO_CONFIG
27
Manuel Pégourié-Gonnard0bc1f232014-04-30 11:53:50 +020028/* System support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020029#define MBEDTLS_HAVE_ASM
30#define MBEDTLS_HAVE_TIME
Manuel Pégourié-Gonnard0bc1f232014-04-30 11:53:50 +020031
Gilles Peskinee820c0a2023-08-03 17:45:20 +020032/* Mbed TLS feature support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020033#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
34#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
35#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
36#define MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020037
Gilles Peskinee820c0a2023-08-03 17:45:20 +020038/* Mbed TLS modules */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020039#define MBEDTLS_ASN1_PARSE_C
40#define MBEDTLS_ASN1_WRITE_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020041#define MBEDTLS_CIPHER_C
42#define MBEDTLS_CTR_DRBG_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020043#define MBEDTLS_ENTROPY_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020044#define MBEDTLS_MD_C
45#define MBEDTLS_NET_C
46#define MBEDTLS_OID_C
47#define MBEDTLS_PK_C
48#define MBEDTLS_PK_PARSE_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020049#define MBEDTLS_SSL_CLI_C
50#define MBEDTLS_SSL_SRV_C
51#define MBEDTLS_SSL_TLS_C
52#define MBEDTLS_X509_CRT_PARSE_C
53#define MBEDTLS_X509_USE_C
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020054
55/* For test certificates */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020056#define MBEDTLS_BASE64_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020057#define MBEDTLS_PEM_PARSE_C
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020058
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020059/* Save RAM at the expense of ROM */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020060#define MBEDTLS_AES_ROM_TABLES
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020061
62/* Save RAM by adjusting to our exact needs */
Gilles Peskined0b16302021-05-28 00:17:26 +020063#define MBEDTLS_MPI_MAX_SIZE 48 // 384-bit EC curve = 48 bytes
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020064
65/* Save RAM at the expense of speed, see ecp.h */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020066#define MBEDTLS_ECP_WINDOW_SIZE 2
67#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020068
Manuel Pégourié-Gonnard0de7f942014-12-01 12:21:01 +010069/* Significant speed benefit at the expense of some ROM */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020070#define MBEDTLS_ECP_NIST_OPTIM
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020071
72/*
73 * You should adjust this to the exact number of sources you're using: default
Manuel Pégourié-Gonnard151dc772015-05-14 13:55:51 +020074 * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020075 * Minimum is 2 for the entropy test suite.
76 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020077#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020078
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020079/* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020080#define MBEDTLS_SSL_CIPHERSUITES \
81 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, \
82 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020083
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020084/*
85 * Save RAM at the expense of interoperability: do this only if you control
Shaun Case8b0ecbc2021-12-20 21:14:10 -080086 * both ends of the connection! (See comments in "mbedtls/ssl.h".)
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020087 * The minimum size here depends on the certificate chain used as well as the
88 * typical size of records.
89 */
David Horstmann95d516f2021-05-04 18:36:56 +010090#define MBEDTLS_SSL_IN_CONTENT_LEN 1024
91#define MBEDTLS_SSL_OUT_CONTENT_LEN 1024
Andrzej Kurek01005b92022-01-17 15:32:02 +010092
93/* These defines are present so that the config modifying scripts can enable
94 * them during tests/scripts/test-ref-configs.pl */
95//#define MBEDTLS_USE_PSA_CRYPTO
96//#define MBEDTLS_PSA_CRYPTO_C
Gilles Peskinec6d197b2022-02-25 21:00:16 +010097
98/* Error messages and TLS debugging traces
99 * (huge code size increase, needed for tests/ssl-opt.sh) */
100//#define MBEDTLS_DEBUG_C
101//#define MBEDTLS_ERROR_C