blob: 24cce6b4d2abf0ef4e9d14d9d93b3af1accb8061 [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
Hanno Beckerabc22b72019-03-18 12:39:49 +000037/* Symmetric crypto: AES-CCM only */
38#define MBEDTLS_CIPHER_C
39#define MBEDTLS_AES_C
40#define MBEDTLS_AES_ROM_TABLES
41#define MBEDTLS_AES_FEWER_TABLES
42#define MBEDTLS_CCM_C
43
44/* Asymmetric crypto: Single-curve ECC only. */
45#define MBEDTLS_BIGNUM_C
46#define MBEDTLS_PK_C
47#define MBEDTLS_PK_PARSE_C
48#define MBEDTLS_PK_WRITE_C
49#define MBEDTLS_ECDH_C
50#define MBEDTLS_ECDSA_C
51#define MBEDTLS_ECP_C
52#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
53#define MBEDTLS_ECP_NIST_OPTIM
54#define MBEDTLS_ECDSA_DETERMINISTIC
Hanno Becker085ab562019-04-03 11:31:31 +010055#define MBEDTLS_ECP_WINDOW_SIZE 2
56#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
57#define MBEDTLS_ECP_MAX_BITS 256
58#define MBEDTLS_MPI_MAX_SIZE 32 // 256 bits is 32 bytes
Hanno Beckerabc22b72019-03-18 12:39:49 +000059
60/* Key exchanges */
61#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
Hanno Becker224eb0c2019-04-10 12:24:10 +010062#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
Hanno Beckerabc22b72019-03-18 12:39:49 +000063
64/* Digests - just SHA-256 */
65#define MBEDTLS_MD_C
66#define MBEDTLS_SHA256_C
67#define MBEDTLS_SHA256_SMALLER
68
69/* TLS options */
70#define MBEDTLS_SSL_CLI_C
71#define MBEDTLS_SSL_TLS_C
72#define MBEDTLS_SSL_PROTO_TLS1_2
73#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
74#define MBEDTLS_SSL_SESSION_TICKETS
75#define MBEDTLS_SSL_COOKIE_C
Hanno Becker275e5bf2019-04-03 13:39:31 +010076#define MBEDTLS_SSL_PROTO_DTLS
Hanno Beckerabc22b72019-03-18 12:39:49 +000077#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
78#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
79#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT
Hanno Beckera5a2b082019-05-15 14:03:01 +010080#define MBEDTLS_SSL_DTLS_CONNECTION_ID
Hanno Beckerabc22b72019-03-18 12:39:49 +000081
82/* X.509 CRT parsing */
83#define MBEDTLS_X509_USE_C
84#define MBEDTLS_X509_CRT_PARSE_C
85#define MBEDTLS_X509_CHECK_KEY_USAGE
86#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
87#define MBEDTLS_ASN1_PARSE_C
88
89/* X.509 CSR writing */
90#define MBEDTLS_X509_CSR_WRITE_C
91#define MBEDTLS_X509_CREATE_C
92#define MBEDTLS_ASN1_WRITE_C
93
94/* RNG and PRNG */
95#define MBEDTLS_NO_PLATFORM_ENTROPY
96#define MBEDTLS_ENTROPY_C
97#define MBEDTLS_HMAC_DRBG_C
98
99#define MBEDTLS_OID_C
100#define MBEDTLS_PLATFORM_C
101
102/* I/O buffer configuration */
103#define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
104
105/* Server-side only */
106#define MBEDTLS_SSL_TICKET_C
107#define MBEDTLS_SSL_SRV_C
108
109#if defined(MBEDTLS_USER_CONFIG_FILE)
110#include MBEDTLS_USER_CONFIG_FILE
111#endif
112
113#include <mbedtls/check_config.h>
114
115#endif /* MBEDTLS_BAREMETAL_CONFIG_H */