blob: dd304c1c5d7ecb25fdf45c5d563a8ff4ba7376b2 [file] [log] [blame]
Ryan Everett4540cd32024-04-25 17:30:30 +01001/**
Harry Ramseyc89fa172025-01-14 11:45:30 +00002 * \file crypto-config-suite-b.h
Ryan Everett4540cd32024-04-25 17:30:30 +01003 *
4 * \brief \brief Minimal crypto configuration for
5 * TLS NSA Suite B Profile (RFC 6460).
6 */
7/*
8 * Copyright The Mbed TLS Contributors
9 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
10 */
11
12/**
13 * Minimal crypto configuration for TLS NSA Suite B Profile (RFC 6460)
14 *
15 * Distinguishing features:
16 * - no RSA or classic DH, fully based on ECC
17 * - optimized for low RAM usage
18 *
19 * Possible improvements:
20 * - if 128-bit security is enough, disable secp384r1 and SHA-512
Ryan Everett4540cd32024-04-25 17:30:30 +010021 *
22 * To be used in conjunction with configs/config-suite-b.h. */
23
Ryan Everett4540cd32024-04-25 17:30:30 +010024#ifndef PSA_CRYPTO_CONFIG_H
25#define PSA_CRYPTO_CONFIG_H
26
Ryan Everett4540cd32024-04-25 17:30:30 +010027#define PSA_WANT_ALG_ECDH 1
28#define PSA_WANT_ALG_ECDSA 1
29#define PSA_WANT_ALG_GCM 1
Ryan Everett4540cd32024-04-25 17:30:30 +010030#define PSA_WANT_ALG_SHA_256 1
31#define PSA_WANT_ALG_SHA_384 1
32#define PSA_WANT_ALG_SHA_512 1
33#define PSA_WANT_ECC_SECP_R1_256 1
Ronald Cronb3a400b2024-05-14 14:26:12 +020034#define PSA_WANT_ECC_SECP_R1_384 1
Ryan Everett4540cd32024-04-25 17:30:30 +010035#define PSA_WANT_ALG_TLS12_PRF 1
Ryan Everett4540cd32024-04-25 17:30:30 +010036
37#define PSA_WANT_KEY_TYPE_AES 1
38#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1
Ryan Everettc3051572024-04-30 17:20:42 +010039#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT 1
Ryan Everett4540cd32024-04-25 17:30:30 +010040#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE 1
Minos Galanakis0d8e3192024-11-01 17:14:05 +000041
42#define MBEDTLS_PSA_CRYPTO_C
Minos Galanakis0d8e3192024-11-01 17:14:05 +000043
44/* System support */
45#define MBEDTLS_HAVE_ASM
46#define MBEDTLS_HAVE_TIME
47
48#define MBEDTLS_ASN1_PARSE_C
49#define MBEDTLS_ASN1_WRITE_C
50#define MBEDTLS_CTR_DRBG_C
51#define MBEDTLS_ENTROPY_C
Minos Galanakis0d8e3192024-11-01 17:14:05 +000052#define MBEDTLS_PK_C
53#define MBEDTLS_PK_PARSE_C
54
55/* For test certificates */
56#define MBEDTLS_BASE64_C
57#define MBEDTLS_PEM_PARSE_C
58
59/* Save RAM at the expense of ROM */
60#define MBEDTLS_AES_ROM_TABLES
61
62/* Save RAM by adjusting to our exact needs */
63#define MBEDTLS_MPI_MAX_SIZE 48 // 384-bit EC curve = 48 bytes
64
65/* Save RAM at the expense of speed, see ecp.h */
66#define MBEDTLS_ECP_WINDOW_SIZE 2
67#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
68
69/* Significant speed benefit at the expense of some ROM */
70#define MBEDTLS_ECP_NIST_OPTIM
71
72/*
73 * You should adjust this to the exact number of sources you're using: default
74 * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
75 * Minimum is 2 for the entropy test suite.
76 */
77#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Ryan Everett4540cd32024-04-25 17:30:30 +010078#endif /* PSA_CRYPTO_CONFIG_H */