• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * \file config-suite-b.h
3  *
4  * \brief Minimal configuration for TLS NSA Suite B Profile (RFC 6460)
5  */
6 /*
7  *  Copyright The Mbed TLS Contributors
8  *  SPDX-License-Identifier: Apache-2.0
9  *
10  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
11  *  not use this file except in compliance with the License.
12  *  You may obtain a copy of the License at
13  *
14  *  http://www.apache.org/licenses/LICENSE-2.0
15  *
16  *  Unless required by applicable law or agreed to in writing, software
17  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  *  See the License for the specific language governing permissions and
20  *  limitations under the License.
21  */
22 /*
23  * Minimal configuration for TLS NSA Suite B Profile (RFC 6460)
24  *
25  * Distinguishing features:
26  * - no RSA or classic DH, fully based on ECC
27  * - optimized for low RAM usage
28  *
29  * Possible improvements:
30  * - if 128-bit security is enough, disable secp384r1 and SHA-512
31  * - use embedded certs in DER format and disable PEM_PARSE_C and BASE64_C
32  *
33  * See README.txt for usage instructions.
34  */
35 
36 #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
37 #define MBEDTLS_RSA_C
38 #define MBEDTLS_THREADING_C
39 #define MBEDTLS_THREADING_PTHREAD
40 #define MBEDTLS_FS_IO
41 #define MBEDTLS_SSL_TICKET_C
42 #define MBEDTLS_MD5_C
43 #define MBEDTLS_DEBUG_C
44 #define MBEDTLS_CIPHER_MODE_CBC
45 #define MBEDTLS_SSL_RENEGOTIATION
46 #define MBEDTLS_ARC4_C
47 #define MBEDTLS_ERROR_C
48 #define MBEDTLS_X509_CRL_PARSE_C
49 #define MBEDTLS_VERSION_C
50 #define MBEDTLS_PK_WRITE_C
51 #define MBEDTLS_SSL_SRV_C
52 #define MBEDTLS_SSL_SESSION_TICKETS
53 #define MBEDTLS_PKCS5_C
54 #define MBEDTLS_DES_C
55 #define MBEDTLS_VENDOR_ARM_ALG
56 #define MBEDTLS_SSL_CLI_C
57 #define MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED
58 #define MBEDTLS_X509_CRT_PARSE_C
59 #define MBEDTLS_X509_CRT_WRITE_C
60 #define MBEDTLS_X509_CREATE_C
61 #define MBEDTLS_PLATFORM_C
62 #define MBEDTLS_DHM_C
63 #define MBEDTLS_SSL_CACHE_C
64 #define MBEDTLS_SHA1_C
65 #define MBEDTLS_PKCS1_V15
66 #define MBEDTLS_X509_CSR_WRITE_C
67 #define MBEDTLS_PEM_WRITE_C
68 #define MBEDTLS_GENPRIME
69 
70 #define MBEDTLS_HAVE_ASM
71 #define MBEDTLS_HAVE_TIME
72 
73 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
74 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
75 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
76 #define MBEDTLS_SSL_PROTO_TLS1_2
77 
78 #define MBEDTLS_AES_C
79 #define MBEDTLS_ASN1_PARSE_C
80 #define MBEDTLS_ASN1_WRITE_C
81 #define MBEDTLS_BIGNUM_C
82 #define MBEDTLS_CIPHER_C
83 #define MBEDTLS_CTR_DRBG_C
84 #define MBEDTLS_ECDH_C
85 #define MBEDTLS_ECDSA_C
86 #define MBEDTLS_ECP_C
87 #define MBEDTLS_ENTROPY_C
88 #define MBEDTLS_GCM_C
89 #define MBEDTLS_MD_C
90 #define MBEDTLS_NET_C
91 #define MBEDTLS_OID_C
92 #define MBEDTLS_PK_C
93 #define MBEDTLS_PK_PARSE_C
94 
95 #define MBEDTLS_SHA224_C
96 #define MBEDTLS_SHA256_C
97 #define MBEDTLS_SHA384_C
98 #define MBEDTLS_SHA512_C
99 #define MBEDTLS_SSL_CLI_C
100 #define MBEDTLS_SSL_SRV_C
101 #define MBEDTLS_SSL_TLS_C
102 #define MBEDTLS_X509_CRT_PARSE_C
103 #define MBEDTLS_X509_USE_C
104 
105 #define MBEDTLS_BASE64_C
106 #define MBEDTLS_PEM_PARSE_C
107 
108 #define MBEDTLS_AES_ROM_TABLES
109 
110 #define MBEDTLS_MPI_MAX_SIZE    1024 // 384-bit EC curve = 1024 bytes
111 
112 #define MBEDTLS_ECP_WINDOW_SIZE        2
113 #define MBEDTLS_ECP_FIXED_POINT_OPTIM  0
114 
115 #define MBEDTLS_ECP_NIST_OPTIM
116 
117 #define MBEDTLS_ENTROPY_MAX_SOURCES 2
118 
119 #define MBEDTLS_SSL_CIPHERSUITES                        \
120     MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,    \
121     MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
122 
123 #define MBEDTLS_SSL_IN_CONTENT_LEN             16384
124 #define MBEDTLS_SSL_OUT_CONTENT_LEN             16384
125