blob: 9fce42422bcb9cc2384804c4ec4b4956cc6f2914 [file] [log] [blame]
Juan Castilloa57a4d52015-04-02 15:44:20 +01001/*
dp-arm52b1fe52017-03-07 10:08:42 +00002 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
Juan Castilloa57a4d52015-04-02 15:44:20 +01003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30#ifndef __MBEDTLS_CONFIG_H__
31#define __MBEDTLS_CONFIG_H__
32
33/*
Juan Castillobae6b2a2015-11-05 09:24:53 +000034 * Key algorithms currently supported on mbed TLS libraries
Juan Castilloa57a4d52015-04-02 15:44:20 +010035 */
dp-arm52b1fe52017-03-07 10:08:42 +000036#define TBBR_RSA 1
37#define TBBR_ECDSA 2
Juan Castilloa57a4d52015-04-02 15:44:20 +010038
39/*
Juan Castillobae6b2a2015-11-05 09:24:53 +000040 * Configuration file to build mbed TLS with the required features for
Juan Castilloa57a4d52015-04-02 15:44:20 +010041 * Trusted Boot
42 */
43
Juan Castillobae6b2a2015-11-05 09:24:53 +000044#define MBEDTLS_PLATFORM_MEMORY
45#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
Juan Castilloa57a4d52015-04-02 15:44:20 +010046
Juan Castillobae6b2a2015-11-05 09:24:53 +000047#define MBEDTLS_PKCS1_V15
48#define MBEDTLS_PKCS1_V21
Juan Castilloa57a4d52015-04-02 15:44:20 +010049
Juan Castillobae6b2a2015-11-05 09:24:53 +000050#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
51#define MBEDTLS_X509_CHECK_KEY_USAGE
52#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
Juan Castilloa57a4d52015-04-02 15:44:20 +010053
Juan Castillobae6b2a2015-11-05 09:24:53 +000054#define MBEDTLS_ASN1_PARSE_C
55#define MBEDTLS_ASN1_WRITE_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010056
Juan Castillobae6b2a2015-11-05 09:24:53 +000057#define MBEDTLS_BASE64_C
58#define MBEDTLS_BIGNUM_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010059
Juan Castillobae6b2a2015-11-05 09:24:53 +000060#define MBEDTLS_ERROR_C
61#define MBEDTLS_MD_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010062
Juan Castillobae6b2a2015-11-05 09:24:53 +000063#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
64#define MBEDTLS_OID_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010065
Juan Castillobae6b2a2015-11-05 09:24:53 +000066#define MBEDTLS_PK_C
67#define MBEDTLS_PK_PARSE_C
68#define MBEDTLS_PK_WRITE_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010069
Juan Castillobae6b2a2015-11-05 09:24:53 +000070#define MBEDTLS_PLATFORM_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010071
dp-arm52b1fe52017-03-07 10:08:42 +000072#if (TBBR_KEY_ALG_ID == TBBR_ECDSA)
Juan Castillobae6b2a2015-11-05 09:24:53 +000073#define MBEDTLS_ECDSA_C
74#define MBEDTLS_ECP_C
75#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
dp-arm52b1fe52017-03-07 10:08:42 +000076#elif (TBBR_KEY_ALG_ID == TBBR_RSA)
Juan Castillobae6b2a2015-11-05 09:24:53 +000077#define MBEDTLS_RSA_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010078#endif
79
Juan Castillobae6b2a2015-11-05 09:24:53 +000080#define MBEDTLS_SHA256_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010081
Juan Castillobae6b2a2015-11-05 09:24:53 +000082#define MBEDTLS_VERSION_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010083
Juan Castillobae6b2a2015-11-05 09:24:53 +000084#define MBEDTLS_X509_USE_C
85#define MBEDTLS_X509_CRT_PARSE_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010086
87/* MPI / BIGNUM options */
Juan Castillobae6b2a2015-11-05 09:24:53 +000088#define MBEDTLS_MPI_WINDOW_SIZE 2
89#define MBEDTLS_MPI_MAX_SIZE 256
Juan Castilloa57a4d52015-04-02 15:44:20 +010090
91/* Memory buffer allocator options */
Juan Castillobae6b2a2015-11-05 09:24:53 +000092#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 8
Juan Castilloa57a4d52015-04-02 15:44:20 +010093
Juan Castillobae6b2a2015-11-05 09:24:53 +000094#include "mbedtls/check_config.h"
Juan Castilloa57a4d52015-04-02 15:44:20 +010095
Juan Castillobae6b2a2015-11-05 09:24:53 +000096/* System headers required to build mbed TLS with the current configuration */
Juan Castilloa57a4d52015-04-02 15:44:20 +010097#include <stdlib.h>
98
99#endif /* __MBEDTLS_CONFIG_H__ */