blob: 7d8d17c357b1fd90faf76c10bc80e0e1abac0650 [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 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Juan Castilloa57a4d52015-04-02 15:44:20 +01005 */
6#ifndef __MBEDTLS_CONFIG_H__
7#define __MBEDTLS_CONFIG_H__
8
9/*
Juan Castillobae6b2a2015-11-05 09:24:53 +000010 * Key algorithms currently supported on mbed TLS libraries
Juan Castilloa57a4d52015-04-02 15:44:20 +010011 */
David Cunadoc7a1b192017-05-10 16:38:44 +010012#define TF_MBEDTLS_RSA 1
13#define TF_MBEDTLS_ECDSA 2
Juan Castilloa57a4d52015-04-02 15:44:20 +010014
15/*
Juan Castillobae6b2a2015-11-05 09:24:53 +000016 * Configuration file to build mbed TLS with the required features for
Juan Castilloa57a4d52015-04-02 15:44:20 +010017 * Trusted Boot
18 */
19
Juan Castillobae6b2a2015-11-05 09:24:53 +000020#define MBEDTLS_PLATFORM_MEMORY
21#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
Juan Castilloa57a4d52015-04-02 15:44:20 +010022
Juan Castillobae6b2a2015-11-05 09:24:53 +000023#define MBEDTLS_PKCS1_V15
24#define MBEDTLS_PKCS1_V21
Juan Castilloa57a4d52015-04-02 15:44:20 +010025
Juan Castillobae6b2a2015-11-05 09:24:53 +000026#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
27#define MBEDTLS_X509_CHECK_KEY_USAGE
28#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
Juan Castilloa57a4d52015-04-02 15:44:20 +010029
Juan Castillobae6b2a2015-11-05 09:24:53 +000030#define MBEDTLS_ASN1_PARSE_C
31#define MBEDTLS_ASN1_WRITE_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010032
Juan Castillobae6b2a2015-11-05 09:24:53 +000033#define MBEDTLS_BASE64_C
34#define MBEDTLS_BIGNUM_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010035
Juan Castillobae6b2a2015-11-05 09:24:53 +000036#define MBEDTLS_ERROR_C
37#define MBEDTLS_MD_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010038
Juan Castillobae6b2a2015-11-05 09:24:53 +000039#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
40#define MBEDTLS_OID_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010041
Juan Castillobae6b2a2015-11-05 09:24:53 +000042#define MBEDTLS_PK_C
43#define MBEDTLS_PK_PARSE_C
44#define MBEDTLS_PK_WRITE_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010045
Juan Castillobae6b2a2015-11-05 09:24:53 +000046#define MBEDTLS_PLATFORM_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010047
David Cunadoc7a1b192017-05-10 16:38:44 +010048#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
Juan Castillobae6b2a2015-11-05 09:24:53 +000049#define MBEDTLS_ECDSA_C
50#define MBEDTLS_ECP_C
51#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
David Cunadoc7a1b192017-05-10 16:38:44 +010052#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
Juan Castillobae6b2a2015-11-05 09:24:53 +000053#define MBEDTLS_RSA_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010054#endif
55
Juan Castillobae6b2a2015-11-05 09:24:53 +000056#define MBEDTLS_SHA256_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010057
Juan Castillobae6b2a2015-11-05 09:24:53 +000058#define MBEDTLS_VERSION_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010059
Juan Castillobae6b2a2015-11-05 09:24:53 +000060#define MBEDTLS_X509_USE_C
61#define MBEDTLS_X509_CRT_PARSE_C
Juan Castilloa57a4d52015-04-02 15:44:20 +010062
63/* MPI / BIGNUM options */
Juan Castillobae6b2a2015-11-05 09:24:53 +000064#define MBEDTLS_MPI_WINDOW_SIZE 2
65#define MBEDTLS_MPI_MAX_SIZE 256
Juan Castilloa57a4d52015-04-02 15:44:20 +010066
67/* Memory buffer allocator options */
Juan Castillobae6b2a2015-11-05 09:24:53 +000068#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 8
Juan Castilloa57a4d52015-04-02 15:44:20 +010069
Juan Castillobae6b2a2015-11-05 09:24:53 +000070#include "mbedtls/check_config.h"
Juan Castilloa57a4d52015-04-02 15:44:20 +010071
Juan Castillobae6b2a2015-11-05 09:24:53 +000072/* System headers required to build mbed TLS with the current configuration */
Juan Castilloa57a4d52015-04-02 15:44:20 +010073#include <stdlib.h>
74
75#endif /* __MBEDTLS_CONFIG_H__ */