blob: 11cb579d766585fc760f75c8a6f8692c7489b3fa [file] [log] [blame]
Hanno Beckerabc22b72019-03-18 12:39:49 +00001/**
2 * \file baremetal.h
3 *
4 * \brief Test configuration for minimal baremetal Mbed TLS builds
5 * based on the following primitives:
6 * - ECDHE-ECDSA only
7 * - Elliptic curve SECP256R1 only
8 * - SHA-256 only
9 * - AES-CCM-8 only
10 *
11 * The library compiles in this configuration, but the example
12 * programs `ssl_client2` and `ssl_server2` require the
13 * modifications from `baremetal_test.h`.
14 */
15/*
16 * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
17 * SPDX-License-Identifier: Apache-2.0
18 *
19 * Licensed under the Apache License, Version 2.0 (the "License"); you may
20 * not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 *
23 * http://www.apache.org/licenses/LICENSE-2.0
24 *
25 * Unless required by applicable law or agreed to in writing, software
26 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
27 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 * See the License for the specific language governing permissions and
29 * limitations under the License.
30 *
31 * This file is part of mbed TLS (https://tls.mbed.org)
32 */
33
34#ifndef MBEDTLS_BAREMETAL_CONFIG_H
35#define MBEDTLS_BAREMETAL_CONFIG_H
36
37#define MBEDTLS_HAVE_TIME
38#define MBEDTLS_HAVE_TIME_DATE
39
40/* Symmetric crypto: AES-CCM only */
41#define MBEDTLS_CIPHER_C
42#define MBEDTLS_AES_C
43#define MBEDTLS_AES_ROM_TABLES
44#define MBEDTLS_AES_FEWER_TABLES
45#define MBEDTLS_CCM_C
46
47/* Asymmetric crypto: Single-curve ECC only. */
48#define MBEDTLS_BIGNUM_C
49#define MBEDTLS_PK_C
50#define MBEDTLS_PK_PARSE_C
51#define MBEDTLS_PK_WRITE_C
52#define MBEDTLS_ECDH_C
53#define MBEDTLS_ECDSA_C
54#define MBEDTLS_ECP_C
55#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
56#define MBEDTLS_ECP_NIST_OPTIM
57#define MBEDTLS_ECDSA_DETERMINISTIC
Hanno Becker085ab562019-04-03 11:31:31 +010058#define MBEDTLS_ECP_WINDOW_SIZE 2
59#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
60#define MBEDTLS_ECP_MAX_BITS 256
61#define MBEDTLS_MPI_MAX_SIZE 32 // 256 bits is 32 bytes
Hanno Beckerabc22b72019-03-18 12:39:49 +000062
63/* Key exchanges */
64#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
Hanno Becker224eb0c2019-04-10 12:24:10 +010065#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
Hanno Beckerabc22b72019-03-18 12:39:49 +000066
67/* Digests - just SHA-256 */
68#define MBEDTLS_MD_C
69#define MBEDTLS_SHA256_C
70#define MBEDTLS_SHA256_SMALLER
71
72/* TLS options */
73#define MBEDTLS_SSL_CLI_C
74#define MBEDTLS_SSL_TLS_C
75#define MBEDTLS_SSL_PROTO_TLS1_2
76#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
77#define MBEDTLS_SSL_SESSION_TICKETS
78#define MBEDTLS_SSL_COOKIE_C
Hanno Becker275e5bf2019-04-03 13:39:31 +010079#define MBEDTLS_SSL_PROTO_DTLS
Hanno Beckerabc22b72019-03-18 12:39:49 +000080#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
81#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
82#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT
83
84/* X.509 CRT parsing */
85#define MBEDTLS_X509_USE_C
86#define MBEDTLS_X509_CRT_PARSE_C
87#define MBEDTLS_X509_CHECK_KEY_USAGE
88#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
89#define MBEDTLS_ASN1_PARSE_C
90
91/* X.509 CSR writing */
92#define MBEDTLS_X509_CSR_WRITE_C
93#define MBEDTLS_X509_CREATE_C
94#define MBEDTLS_ASN1_WRITE_C
95
96/* RNG and PRNG */
97#define MBEDTLS_NO_PLATFORM_ENTROPY
98#define MBEDTLS_ENTROPY_C
99#define MBEDTLS_HMAC_DRBG_C
100
101#define MBEDTLS_OID_C
102#define MBEDTLS_PLATFORM_C
103
104/* I/O buffer configuration */
105#define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
106
107/* Server-side only */
108#define MBEDTLS_SSL_TICKET_C
109#define MBEDTLS_SSL_SRV_C
110
111#if defined(MBEDTLS_USER_CONFIG_FILE)
112#include MBEDTLS_USER_CONFIG_FILE
113#endif
114
115#include <mbedtls/check_config.h>
116
117#endif /* MBEDTLS_BAREMETAL_CONFIG_H */