Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 1 | /** |
Harry Ramsey | c89fa17 | 2025-01-14 11:45:30 +0000 | [diff] [blame] | 2 | * \file crypto-config-suite-b.h |
Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 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 Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 21 | * |
| 22 | * To be used in conjunction with configs/config-suite-b.h. */ |
| 23 | |
Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 24 | #ifndef PSA_CRYPTO_CONFIG_H |
| 25 | #define PSA_CRYPTO_CONFIG_H |
| 26 | |
Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 27 | #define PSA_WANT_ALG_ECDH 1 |
| 28 | #define PSA_WANT_ALG_ECDSA 1 |
| 29 | #define PSA_WANT_ALG_GCM 1 |
Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 30 | #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 Cron | b3a400b | 2024-05-14 14:26:12 +0200 | [diff] [blame] | 34 | #define PSA_WANT_ECC_SECP_R1_384 1 |
Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 35 | #define PSA_WANT_ALG_TLS12_PRF 1 |
Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 36 | |
| 37 | #define PSA_WANT_KEY_TYPE_AES 1 |
| 38 | #define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1 |
Ryan Everett | c305157 | 2024-04-30 17:20:42 +0100 | [diff] [blame] | 39 | #define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT 1 |
Ryan Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 40 | #define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE 1 |
Minos Galanakis | 0d8e319 | 2024-11-01 17:14:05 +0000 | [diff] [blame] | 41 | |
| 42 | #define MBEDTLS_PSA_CRYPTO_C |
Minos Galanakis | 0d8e319 | 2024-11-01 17:14:05 +0000 | [diff] [blame] | 43 | |
| 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 Galanakis | 0d8e319 | 2024-11-01 17:14:05 +0000 | [diff] [blame] | 52 | #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 Everett | 4540cd3 | 2024-04-25 17:30:30 +0100 | [diff] [blame] | 78 | #endif /* PSA_CRYPTO_CONFIG_H */ |