blob: 1af911c2003facedfc28cca317a09503ccd5e516 [file] [log] [blame]
Raymond Mao13de8482024-10-03 14:50:15 -07001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * MbedTLS config file
4 *
5 * Derived from the MbedTLS internal config file,
6 * for more information about each build option,
7 * please refer to:
8 * external/mbedtls/include/mbedtls/mbedtls_config.h
9 *
10 * Copyright (c) 2024 Linaro Limited
11 * Author: Raymond Mao <raymond.mao@linaro.org>
12 */
13
14#if defined CONFIG_MBEDTLS_LIB
15
16#if CONFIG_IS_ENABLED(MD5)
17#define MBEDTLS_MD_C
18#define MBEDTLS_MD5_C
19#if defined CONFIG_MBEDTLS_LIB_CRYPTO_ALT
20#define MBEDTLS_MD5_ALT
21#endif
22#endif
23
24#if CONFIG_IS_ENABLED(SHA1)
25#define MBEDTLS_MD_C
26#define MBEDTLS_SHA1_C
27#if defined CONFIG_MBEDTLS_LIB_CRYPTO_ALT
28#define MBEDTLS_SHA1_ALT
29#endif
30#endif
31
32#if CONFIG_IS_ENABLED(SHA256)
33#define MBEDTLS_MD_C
34#define MBEDTLS_SHA256_C
35#if defined CONFIG_MBEDTLS_LIB_CRYPTO_ALT
36#define MBEDTLS_SHA256_ALT
37#endif
Raymond Maoc60e99f2024-10-03 14:50:20 -070038#if CONFIG_IS_ENABLED(SHA256_SMALLER)
39#define MBEDTLS_SHA256_SMALLER
40#endif
Raymond Mao13de8482024-10-03 14:50:15 -070041#endif
42
43#if CONFIG_IS_ENABLED(SHA384)
44#define MBEDTLS_MD_C
45#define MBEDTLS_SHA384_C
46#endif
47
48#if CONFIG_IS_ENABLED(SHA512)
49#define MBEDTLS_MD_C
50#define MBEDTLS_SHA512_C
51#if defined CONFIG_MBEDTLS_LIB_CRYPTO_ALT
52#define MBEDTLS_SHA512_ALT
53#endif
Raymond Maoc60e99f2024-10-03 14:50:20 -070054#if CONFIG_IS_ENABLED(SHA512_SMALLER)
55#define MBEDTLS_SHA512_SMALLER
56#endif
Raymond Mao13de8482024-10-03 14:50:15 -070057#endif
58
59#if defined CONFIG_MBEDTLS_LIB_X509
60
61#if CONFIG_IS_ENABLED(X509_CERTIFICATE_PARSER)
62#define MBEDTLS_X509_USE_C
63#define MBEDTLS_X509_CRT_PARSE_C
64#define MBEDTLS_X509_CRL_PARSE_C
65#endif
66
67#if CONFIG_IS_ENABLED(ASYMMETRIC_PUBLIC_KEY_SUBTYPE)
68#define MBEDTLS_PK_C
69#define MBEDTLS_PK_PARSE_C
70#endif
71
72#if CONFIG_IS_ENABLED(RSA_PUBLIC_KEY_PARSER)
73#define MBEDTLS_BIGNUM_C
74#define MBEDTLS_RSA_C
75#define MBEDTLS_PKCS1_V15
76#endif
77
78#if CONFIG_IS_ENABLED(PKCS7_MESSAGE_PARSER)
79#define MBEDTLS_PKCS7_C
80#endif
81
82#if CONFIG_IS_ENABLED(ASN1_DECODER)
83#define MBEDTLS_OID_C
84#define MBEDTLS_ASN1_PARSE_C
85#define MBEDTLS_ASN1_WRITE_C
86#endif
87
88#endif /* #if defined CONFIG_MBEDTLS_LIB_X509 */
89
90#endif /* #if defined CONFIG_MBEDTLS_LIB */