mbedtls_config.h 3.02 KB
Newer Older
1
/*
dp-arm's avatar
dp-arm committed
2
 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of ARM nor the names of its contributors may be used
 * to endorse or promote products derived from this software without specific
 * prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
#ifndef __MBEDTLS_CONFIG_H__
#define __MBEDTLS_CONFIG_H__

/*
Juan Castillo's avatar
Juan Castillo committed
34
 * Key algorithms currently supported on mbed TLS libraries
35
 */
dp-arm's avatar
dp-arm committed
36
37
#define TBBR_RSA	1
#define TBBR_ECDSA	2
38
39

/*
Juan Castillo's avatar
Juan Castillo committed
40
 * Configuration file to build mbed TLS with the required features for
41
42
43
 * Trusted Boot
 */

Juan Castillo's avatar
Juan Castillo committed
44
45
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
46

Juan Castillo's avatar
Juan Castillo committed
47
48
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_PKCS1_V21
49

Juan Castillo's avatar
Juan Castillo committed
50
51
52
#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
53

Juan Castillo's avatar
Juan Castillo committed
54
55
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
56

Juan Castillo's avatar
Juan Castillo committed
57
58
#define MBEDTLS_BASE64_C
#define MBEDTLS_BIGNUM_C
59

Juan Castillo's avatar
Juan Castillo committed
60
61
#define MBEDTLS_ERROR_C
#define MBEDTLS_MD_C
62

Juan Castillo's avatar
Juan Castillo committed
63
64
#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
#define MBEDTLS_OID_C
65

Juan Castillo's avatar
Juan Castillo committed
66
67
68
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PK_WRITE_C
69

Juan Castillo's avatar
Juan Castillo committed
70
#define MBEDTLS_PLATFORM_C
71

dp-arm's avatar
dp-arm committed
72
#if (TBBR_KEY_ALG_ID == TBBR_ECDSA)
Juan Castillo's avatar
Juan Castillo committed
73
74
75
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
dp-arm's avatar
dp-arm committed
76
#elif (TBBR_KEY_ALG_ID == TBBR_RSA)
Juan Castillo's avatar
Juan Castillo committed
77
#define MBEDTLS_RSA_C
78
79
#endif

Juan Castillo's avatar
Juan Castillo committed
80
#define MBEDTLS_SHA256_C
81

Juan Castillo's avatar
Juan Castillo committed
82
#define MBEDTLS_VERSION_C
83

Juan Castillo's avatar
Juan Castillo committed
84
85
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C
86
87

/* MPI / BIGNUM options */
Juan Castillo's avatar
Juan Castillo committed
88
89
#define MBEDTLS_MPI_WINDOW_SIZE              2
#define MBEDTLS_MPI_MAX_SIZE               256
90
91

/* Memory buffer allocator options */
Juan Castillo's avatar
Juan Castillo committed
92
#define MBEDTLS_MEMORY_ALIGN_MULTIPLE        8
93

Juan Castillo's avatar
Juan Castillo committed
94
#include "mbedtls/check_config.h"
95

Juan Castillo's avatar
Juan Castillo committed
96
/* System headers required to build mbed TLS with the current configuration */
97
98
99
#include <stdlib.h>

#endif /* __MBEDTLS_CONFIG_H__ */