blob: eeb28ec155710b7a7f92c6568e77417be011c036 [file] [log] [blame]
Raymond Mao87010c32024-10-03 14:50:15 -07001# SPDX-License-Identifier: GPL-2.0+
2#
3# Copyright (c) 2024 Linaro Limited
4# Author: Raymond Mao <raymond.mao@linaro.org>
5
6MBEDTLS_LIB_DIR = external/mbedtls/library
7
Raymond Maof51f3552024-10-03 14:50:19 -07008# shim layer for hash
9obj-$(CONFIG_$(SPL_)MD5_MBEDTLS) += md5.o
10obj-$(CONFIG_$(SPL_)SHA1_MBEDTLS) += sha1.o
11obj-$(CONFIG_$(SPL_)SHA256_MBEDTLS) += sha256.o
12obj-$(CONFIG_$(SPL_)SHA512_MBEDTLS) += sha512.o
13
Raymond Mao87010c32024-10-03 14:50:15 -070014# MbedTLS crypto library
15obj-$(CONFIG_MBEDTLS_LIB) += mbedtls_lib_crypto.o
16mbedtls_lib_crypto-y := \
17 $(MBEDTLS_LIB_DIR)/platform_util.o \
18 $(MBEDTLS_LIB_DIR)/constant_time.o \
19 $(MBEDTLS_LIB_DIR)/md.o
Raymond Maof51f3552024-10-03 14:50:19 -070020mbedtls_lib_crypto-$(CONFIG_$(SPL_)MD5_MBEDTLS) += $(MBEDTLS_LIB_DIR)/md5.o
21mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA1_MBEDTLS) += $(MBEDTLS_LIB_DIR)/sha1.o
22mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA256_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070023 $(MBEDTLS_LIB_DIR)/sha256.o
Raymond Maof51f3552024-10-03 14:50:19 -070024mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA512_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070025 $(MBEDTLS_LIB_DIR)/sha512.o
26
27# MbedTLS X509 library
28obj-$(CONFIG_MBEDTLS_LIB_X509) += mbedtls_lib_x509.o
29mbedtls_lib_x509-y := $(MBEDTLS_LIB_DIR)/x509.o
30mbedtls_lib_x509-$(CONFIG_$(SPL_)ASN1_DECODER) += \
31 $(MBEDTLS_LIB_DIR)/asn1parse.o \
32 $(MBEDTLS_LIB_DIR)/asn1write.o \
33 $(MBEDTLS_LIB_DIR)/oid.o
34mbedtls_lib_x509-$(CONFIG_$(SPL_)RSA_PUBLIC_KEY_PARSER) += \
35 $(MBEDTLS_LIB_DIR)/bignum.o \
36 $(MBEDTLS_LIB_DIR)/bignum_core.o \
37 $(MBEDTLS_LIB_DIR)/rsa.o \
38 $(MBEDTLS_LIB_DIR)/rsa_alt_helpers.o
39mbedtls_lib_x509-$(CONFIG_$(SPL_)ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += \
40 $(MBEDTLS_LIB_DIR)/pk.o \
41 $(MBEDTLS_LIB_DIR)/pk_wrap.o \
42 $(MBEDTLS_LIB_DIR)/pkparse.o
43mbedtls_lib_x509-$(CONFIG_$(SPL_)X509_CERTIFICATE_PARSER) += \
44 $(MBEDTLS_LIB_DIR)/x509_crl.o \
45 $(MBEDTLS_LIB_DIR)/x509_crt.o
46mbedtls_lib_x509-$(CONFIG_$(SPL_)PKCS7_MESSAGE_PARSER) += \
47 $(MBEDTLS_LIB_DIR)/pkcs7.o