blob: 3fec3d0f108bdf4ac78b020c80b3ded3775595f4 [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
52#define MBEDTLS_OID_C
53#define MBEDTLS_PK_C
54#define MBEDTLS_PK_PARSE_C
55
56/* For test certificates */
57#define MBEDTLS_BASE64_C
58#define MBEDTLS_PEM_PARSE_C
59
60/* Save RAM at the expense of ROM */
61#define MBEDTLS_AES_ROM_TABLES
62
63/* Save RAM by adjusting to our exact needs */
64#define MBEDTLS_MPI_MAX_SIZE 48 // 384-bit EC curve = 48 bytes
65
66/* Save RAM at the expense of speed, see ecp.h */
67#define MBEDTLS_ECP_WINDOW_SIZE 2
68#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
69
70/* Significant speed benefit at the expense of some ROM */
71#define MBEDTLS_ECP_NIST_OPTIM
72
73/*
74 * You should adjust this to the exact number of sources you're using: default
75 * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
76 * Minimum is 2 for the entropy test suite.
77 */
78#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Ryan Everett4540cd32024-04-25 17:30:30 +010079#endif /* PSA_CRYPTO_CONFIG_H */