blob: 04d450afd8284947c46a22870839f09e87dc616d [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 Mao702817b2024-10-03 14:50:28 -070014# x509 libraries
15obj-$(CONFIG_$(SPL_)ASYMMETRIC_PUBLIC_KEY_MBEDTLS) += \
16 public_key.o
Raymond Mao7deec0f2024-10-03 14:50:30 -070017obj-$(CONFIG_$(SPL_)X509_CERTIFICATE_PARSER_MBEDTLS) += \
18 x509_cert_parser.o
Raymond Mao7b3dfd02024-10-03 14:50:32 -070019obj-$(CONFIG_$(SPL_)PKCS7_MESSAGE_PARSER_MBEDTLS) += pkcs7_parser.o
Raymond Maocd17ac22024-10-03 14:50:34 -070020obj-$(CONFIG_$(SPL_)MSCODE_PARSER_MBEDTLS) += mscode_parser.o
Raymond Mao42948e82024-10-03 14:50:36 -070021obj-$(CONFIG_$(SPL_)RSA_PUBLIC_KEY_PARSER_MBEDTLS) += rsa_helper.o
Raymond Mao702817b2024-10-03 14:50:28 -070022
Raymond Mao87010c32024-10-03 14:50:15 -070023# MbedTLS crypto library
24obj-$(CONFIG_MBEDTLS_LIB) += mbedtls_lib_crypto.o
25mbedtls_lib_crypto-y := \
26 $(MBEDTLS_LIB_DIR)/platform_util.o \
27 $(MBEDTLS_LIB_DIR)/constant_time.o \
28 $(MBEDTLS_LIB_DIR)/md.o
Raymond Maof51f3552024-10-03 14:50:19 -070029mbedtls_lib_crypto-$(CONFIG_$(SPL_)MD5_MBEDTLS) += $(MBEDTLS_LIB_DIR)/md5.o
30mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA1_MBEDTLS) += $(MBEDTLS_LIB_DIR)/sha1.o
31mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA256_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070032 $(MBEDTLS_LIB_DIR)/sha256.o
Raymond Maof51f3552024-10-03 14:50:19 -070033mbedtls_lib_crypto-$(CONFIG_$(SPL_)SHA512_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070034 $(MBEDTLS_LIB_DIR)/sha512.o
35
36# MbedTLS X509 library
37obj-$(CONFIG_MBEDTLS_LIB_X509) += mbedtls_lib_x509.o
38mbedtls_lib_x509-y := $(MBEDTLS_LIB_DIR)/x509.o
39mbedtls_lib_x509-$(CONFIG_$(SPL_)ASN1_DECODER) += \
40 $(MBEDTLS_LIB_DIR)/asn1parse.o \
41 $(MBEDTLS_LIB_DIR)/asn1write.o \
42 $(MBEDTLS_LIB_DIR)/oid.o
Raymond Mao42948e82024-10-03 14:50:36 -070043mbedtls_lib_x509-$(CONFIG_$(SPL_)RSA_PUBLIC_KEY_PARSER_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070044 $(MBEDTLS_LIB_DIR)/bignum.o \
45 $(MBEDTLS_LIB_DIR)/bignum_core.o \
46 $(MBEDTLS_LIB_DIR)/rsa.o \
47 $(MBEDTLS_LIB_DIR)/rsa_alt_helpers.o
Raymond Mao702817b2024-10-03 14:50:28 -070048mbedtls_lib_x509-$(CONFIG_$(SPL_)ASYMMETRIC_PUBLIC_KEY_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070049 $(MBEDTLS_LIB_DIR)/pk.o \
50 $(MBEDTLS_LIB_DIR)/pk_wrap.o \
51 $(MBEDTLS_LIB_DIR)/pkparse.o
Raymond Mao7deec0f2024-10-03 14:50:30 -070052mbedtls_lib_x509-$(CONFIG_$(SPL_)X509_CERTIFICATE_PARSER_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070053 $(MBEDTLS_LIB_DIR)/x509_crl.o \
54 $(MBEDTLS_LIB_DIR)/x509_crt.o
Raymond Mao7b3dfd02024-10-03 14:50:32 -070055mbedtls_lib_x509-$(CONFIG_$(SPL_)PKCS7_MESSAGE_PARSER_MBEDTLS) += \
Raymond Mao87010c32024-10-03 14:50:15 -070056 $(MBEDTLS_LIB_DIR)/pkcs7.o