blob: 6fba053bd7cfc92372aed3ee3ec522ad557d71bb [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
38#endif
39
40#if CONFIG_IS_ENABLED(SHA384)
41#define MBEDTLS_MD_C
42#define MBEDTLS_SHA384_C
43#endif
44
45#if CONFIG_IS_ENABLED(SHA512)
46#define MBEDTLS_MD_C
47#define MBEDTLS_SHA512_C
48#if defined CONFIG_MBEDTLS_LIB_CRYPTO_ALT
49#define MBEDTLS_SHA512_ALT
50#endif
51#endif
52
53#if defined CONFIG_MBEDTLS_LIB_X509
54
55#if CONFIG_IS_ENABLED(X509_CERTIFICATE_PARSER)
56#define MBEDTLS_X509_USE_C
57#define MBEDTLS_X509_CRT_PARSE_C
58#define MBEDTLS_X509_CRL_PARSE_C
59#endif
60
61#if CONFIG_IS_ENABLED(ASYMMETRIC_PUBLIC_KEY_SUBTYPE)
62#define MBEDTLS_PK_C
63#define MBEDTLS_PK_PARSE_C
64#endif
65
66#if CONFIG_IS_ENABLED(RSA_PUBLIC_KEY_PARSER)
67#define MBEDTLS_BIGNUM_C
68#define MBEDTLS_RSA_C
69#define MBEDTLS_PKCS1_V15
70#endif
71
72#if CONFIG_IS_ENABLED(PKCS7_MESSAGE_PARSER)
73#define MBEDTLS_PKCS7_C
74#endif
75
76#if CONFIG_IS_ENABLED(ASN1_DECODER)
77#define MBEDTLS_OID_C
78#define MBEDTLS_ASN1_PARSE_C
79#define MBEDTLS_ASN1_WRITE_C
80#endif
81
82#endif /* #if defined CONFIG_MBEDTLS_LIB_X509 */
83
84#endif /* #if defined CONFIG_MBEDTLS_LIB */