• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 Huawei Technologies Co., Ltd.
2# Licensed under the Mulan PSL v2.
3# You can use this software according to the terms and conditions of the Mulan PSL v2.
4# You may obtain a copy of Mulan PSL v2 at:
5#     http://license.coscl.org.cn/MulanPSL2
6# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
7# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
8# PURPOSE.
9# See the Mulan PSL v2 for more details.
10MODULE := libcrypto_hal${TARG}.a
11include $(BUILD_CONFIG)/feature-macro.mk
12
13ifeq ($(CONFIG_CRYPTO_SUPPORT_EC25519),true)
14c-flags += -DCRYPTO_SSL_SUPPORT_EC25519
15endif
16
17ifeq ($(CONFIG_CRYPTO_SOFT_ENGINE),openssl3)
18    c-flags += -DOPENSSL3_ENABLE
19else
20    c-flags += -DOPENSSL_ENABLE
21endif
22
23ifneq ($(CONFIG_TEE_CRYPTO_MGR_SERVER_64BIT), )
24c-flags += -DCRYPTO_MGR_SERVER_ENABLE
25endif
26
27inc-flags += -I$(TEELIB)/libcrypto_hal/include
28inc-flags += -I$(DRIVERS_PATH)/crypto_mgr/src/crypto_ioctl
29inc-flags += -I$(DRIVERS_PATH)/include
30inc-flags += -I$(TEELIB)/libteeconfig/include
31inc-flags += -I$(TEELIB)/libdrv/include
32inc-flags += -I$(TEELIB)/libteeos/include/tee
33inc-flags += -I$(TEELIB)/libteeos/include
34inc-flags += -I$(TEELIB)/libteeos/include/legacy
35inc-flags += -I$(TEELIB)/libcrypto/include
36inc-flags += -I$(TEELIB)/libswcrypto_engine/include
37inc-flags += -I$(TEELIB)/libteemem/include
38inc-flags += -I$(TEELIB)/libssa/include
39inc-flags += -I$(PREBUILD_HEADER)/sys
40
41ifneq ($(findstring $(CONFIG_CRYPTO_SOFT_ENGINE), openssl openssl3),)
42inc-flags += -I$(TEELIB)/libopenssl/openssl/include
43inc-flags += -I$(TEELIB)/libopenssl/openssl/crypto
44inc-flags += -I$(TEELIB)/libopenssl/openssl/ohos_lite
45endif
46
47# Source files required to build the target
48libcrypto_hal_c_files += $(wildcard src/*.c) \
49                         $(wildcard src/stub/*.c) \
50                         $(wildcard src/boringssl/*.c)
51
52ifeq ($(CONFIG_CRYPTO_SUPPORT_SOFT_ECC),true)
53c-flags += -DCRYPTO_SUPPORT_SOFT_ECC
54libcrypto_hal_c_files := $(filter-out src/stub/soft_ec_api.c, $(libcrypto_hal_c_files))
55else
56libcrypto_hal_c_files := $(filter-out src/boringssl/soft_ec_api.c, $(libcrypto_hal_c_files))
57endif
58
59ifeq ($(CONFIG_CRYPTO_SUPPORT_SOFT_SM2),true)
60c-flags += -DCRYPTO_SUPPORT_SOFT_SM2
61libcrypto_hal_c_files := $(filter-out src/stub/soft_gmssl_asym.c, $(libcrypto_hal_c_files))
62else
63libcrypto_hal_c_files := $(filter-out src/boringssl/soft_gmssl_asym.c, $(libcrypto_hal_c_files))
64endif
65include $(BUILD_LIB)/lib-common.mk
66