blob: dcb814562d67d602ffbd9f2a8ddac371dff70be9 [file] [log] [blame]
Ryan Everett4540cd32024-04-25 17:30:30 +01001/**
2 * \file crypto-config-symmetric-only.h
3 *
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
43#define MBEDTLS_USE_PSA_CRYPTO
44
45/* System support */
46#define MBEDTLS_HAVE_ASM
47#define MBEDTLS_HAVE_TIME
48
49#define MBEDTLS_ASN1_PARSE_C
50#define MBEDTLS_ASN1_WRITE_C
51#define MBEDTLS_CTR_DRBG_C
52#define MBEDTLS_ENTROPY_C
53#define MBEDTLS_OID_C
54#define MBEDTLS_PK_C
55#define MBEDTLS_PK_PARSE_C
56
57/* For test certificates */
58#define MBEDTLS_BASE64_C
59#define MBEDTLS_PEM_PARSE_C
60
61/* Save RAM at the expense of ROM */
62#define MBEDTLS_AES_ROM_TABLES
63
64/* Save RAM by adjusting to our exact needs */
65#define MBEDTLS_MPI_MAX_SIZE 48 // 384-bit EC curve = 48 bytes
66
67/* Save RAM at the expense of speed, see ecp.h */
68#define MBEDTLS_ECP_WINDOW_SIZE 2
69#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
70
71/* Significant speed benefit at the expense of some ROM */
72#define MBEDTLS_ECP_NIST_OPTIM
73
74/*
75 * You should adjust this to the exact number of sources you're using: default
76 * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
77 * Minimum is 2 for the entropy test suite.
78 */
79#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Ryan Everett4540cd32024-04-25 17:30:30 +010080#endif /* PSA_CRYPTO_CONFIG_H */