mbedtls_config.h 1.84 KB
Newer Older
1
/*
dp-arm's avatar
dp-arm committed
2
 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
7
8
9
 */
#ifndef __MBEDTLS_CONFIG_H__
#define __MBEDTLS_CONFIG_H__

/*
Juan Castillo's avatar
Juan Castillo committed
10
 * Key algorithms currently supported on mbed TLS libraries
11
 */
12
13
#define TF_MBEDTLS_RSA			1
#define TF_MBEDTLS_ECDSA		2
14
15

/*
Juan Castillo's avatar
Juan Castillo committed
16
 * Configuration file to build mbed TLS with the required features for
17
18
19
 * Trusted Boot
 */

Juan Castillo's avatar
Juan Castillo committed
20
21
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
22
23
/* Prevent mbed TLS from using snprintf so that it can use tf_snprintf. */
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
24

25
#if !ERROR_DEPRECATED
Juan Castillo's avatar
Juan Castillo committed
26
#define MBEDTLS_PKCS1_V15
27
#endif
Juan Castillo's avatar
Juan Castillo committed
28
#define MBEDTLS_PKCS1_V21
29

Juan Castillo's avatar
Juan Castillo committed
30
31
32
#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
33

Juan Castillo's avatar
Juan Castillo committed
34
35
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
36

Juan Castillo's avatar
Juan Castillo committed
37
38
#define MBEDTLS_BASE64_C
#define MBEDTLS_BIGNUM_C
39

Juan Castillo's avatar
Juan Castillo committed
40
41
#define MBEDTLS_ERROR_C
#define MBEDTLS_MD_C
42

Juan Castillo's avatar
Juan Castillo committed
43
44
#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
#define MBEDTLS_OID_C
45

Juan Castillo's avatar
Juan Castillo committed
46
47
48
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PK_WRITE_C
49

Juan Castillo's avatar
Juan Castillo committed
50
#define MBEDTLS_PLATFORM_C
51

52
#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
Juan Castillo's avatar
Juan Castillo committed
53
54
55
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
56
#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
Juan Castillo's avatar
Juan Castillo committed
57
#define MBEDTLS_RSA_C
58
#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
59
60
#endif

Juan Castillo's avatar
Juan Castillo committed
61
#define MBEDTLS_SHA256_C
62

Juan Castillo's avatar
Juan Castillo committed
63
#define MBEDTLS_VERSION_C
64

Juan Castillo's avatar
Juan Castillo committed
65
66
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C
67
68

/* MPI / BIGNUM options */
Juan Castillo's avatar
Juan Castillo committed
69
70
#define MBEDTLS_MPI_WINDOW_SIZE              2
#define MBEDTLS_MPI_MAX_SIZE               256
71

Isla Mitchell's avatar
Isla Mitchell committed
72
73
74
/* System headers required to build mbed TLS with the current configuration */
#include <stdlib.h>

75
/* Memory buffer allocator options */
Juan Castillo's avatar
Juan Castillo committed
76
#define MBEDTLS_MEMORY_ALIGN_MULTIPLE        8
77

Juan Castillo's avatar
Juan Castillo committed
78
#include "mbedtls/check_config.h"
79
80

#endif /* __MBEDTLS_CONFIG_H__ */