1f6603c60Sopenharmony_ci# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
2f6603c60Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3f6603c60Sopenharmony_ci# you may not use this file except in compliance with the License.
4f6603c60Sopenharmony_ci# You may obtain a copy of the License at
5f6603c60Sopenharmony_ci#
6f6603c60Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7f6603c60Sopenharmony_ci#
8f6603c60Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9f6603c60Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10f6603c60Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11f6603c60Sopenharmony_ci# See the License for the specific language governing permissions and
12f6603c60Sopenharmony_ci# limitations under the License.
13f6603c60Sopenharmony_ci
14f6603c60Sopenharmony_cibase_root = "../../../../../../"
15f6603c60Sopenharmony_ciimport("$base_root/base/security/huks/build/config.gni")
16f6603c60Sopenharmony_ciimport("$base_root/base/security/huks/huks.gni")
17f6603c60Sopenharmony_ciimport("$base_root/test/xts/tools/build/suite.gni")
18f6603c60Sopenharmony_ci
19f6603c60Sopenharmony_ciconfig("module_private_config") {
20f6603c60Sopenharmony_ci  visibility = [ ":*" ]
21f6603c60Sopenharmony_ci  include_dirs = [
22f6603c60Sopenharmony_ci    "$base_root/commonlibrary/c_utils/base/include",
23f6603c60Sopenharmony_ci    "$base_root/third_party/bounds_checking_function/include",
24f6603c60Sopenharmony_ci    "include",
25f6603c60Sopenharmony_ci  ]
26f6603c60Sopenharmony_ci}
27f6603c60Sopenharmony_ci
28f6603c60Sopenharmony_ciohos_moduletest_suite("ActsHuksNAPITest") {
29f6603c60Sopenharmony_ci  configs = [ ":module_private_config" ]
30f6603c60Sopenharmony_ci  cflags_cc = [ "-DHILOG_ENABLE" ]
31f6603c60Sopenharmony_ci  defines = [
32f6603c60Sopenharmony_ci    "_STANDARD_SYSTEM_",
33f6603c60Sopenharmony_ci    "CONFIG_HUKS_STAGED",
34f6603c60Sopenharmony_ci    "_USE_OPENSSL_",
35f6603c60Sopenharmony_ci  ]
36f6603c60Sopenharmony_ci  subsystem_name = "security"
37f6603c60Sopenharmony_ci  part_name = "huks"
38f6603c60Sopenharmony_ci
39f6603c60Sopenharmony_ci  sources = [
40f6603c60Sopenharmony_ci    "src/huks_agree_dh_test.cpp",
41f6603c60Sopenharmony_ci    "src/huks_agree_ecdh_test.cpp",
42f6603c60Sopenharmony_ci    "src/huks_agree_ecdh_test_common.cpp",
43f6603c60Sopenharmony_ci    "src/huks_agree_x25519_test.cpp",
44f6603c60Sopenharmony_ci    "src/huks_cipher_aes_test.cpp",
45f6603c60Sopenharmony_ci    "src/huks_cipher_aes_test_common.cpp",
46f6603c60Sopenharmony_ci    "src/huks_cipher_rsa_test.cpp",
47f6603c60Sopenharmony_ci    "src/huks_cipher_rsa_test_common.cpp",
48f6603c60Sopenharmony_ci    "src/huks_cipher_sm4_test.cpp",
49f6603c60Sopenharmony_ci    "src/huks_cipher_sm4_test_common.cpp",
50f6603c60Sopenharmony_ci    "src/huks_derive_hkdf_test.cpp",
51f6603c60Sopenharmony_ci    "src/huks_derive_hkdf_test_common.cpp",
52f6603c60Sopenharmony_ci    "src/huks_derive_pbkdf_test.cpp",
53f6603c60Sopenharmony_ci    "src/huks_derive_pbkdf_test_common.cpp",
54f6603c60Sopenharmony_ci    "src/huks_hmac_test.cpp",
55f6603c60Sopenharmony_ci    "src/huks_mem.cpp",
56f6603c60Sopenharmony_ci    "src/huks_misc_test.cpp",
57f6603c60Sopenharmony_ci    "src/huks_nullptr_test.cpp",
58f6603c60Sopenharmony_ci    "src/huks_signverify_ecc_test.cpp",
59f6603c60Sopenharmony_ci    "src/huks_signverify_ecc_test_common.cpp",
60f6603c60Sopenharmony_ci    "src/huks_signverify_ed25519_test.cpp",
61f6603c60Sopenharmony_ci    "src/huks_signverify_rsa_test.cpp",
62f6603c60Sopenharmony_ci    "src/huks_signverify_rsa_test_common.cpp",
63f6603c60Sopenharmony_ci    "src/huks_signverify_sm2_test.cpp",
64f6603c60Sopenharmony_ci    "src/huks_three_stage_test_common.cpp",
65f6603c60Sopenharmony_ci    "src/huks_warpped_test.cpp",
66f6603c60Sopenharmony_ci    "src/huks_wrapped_test_common.cpp",
67f6603c60Sopenharmony_ci  ]
68f6603c60Sopenharmony_ci
69f6603c60Sopenharmony_ci  if (huks_security_level != "trusted_environment") {
70f6603c60Sopenharmony_ci    sources += [
71f6603c60Sopenharmony_ci      "src/huks_attest_test.cpp",
72f6603c60Sopenharmony_ci      "src/huks_attest_test_common.cpp",
73f6603c60Sopenharmony_ci      "src/huks_signverify_dsa_test.cpp",
74f6603c60Sopenharmony_ci    ]
75f6603c60Sopenharmony_ci  }
76f6603c60Sopenharmony_ci
77f6603c60Sopenharmony_ci  include_dirs = [
78f6603c60Sopenharmony_ci    "$base_root/test/xts/acts/security/security_huks_basic/huks_napi_BasicTest/include",
79f6603c60Sopenharmony_ci    "include",
80f6603c60Sopenharmony_ci    "$base_root/base/security/huks/interfaces/kits/c/include",
81f6603c60Sopenharmony_ci    "commonlibrary/c_utils/base/include",
82f6603c60Sopenharmony_ci  ]
83f6603c60Sopenharmony_ci
84f6603c60Sopenharmony_ci  external_deps = [
85f6603c60Sopenharmony_ci    "c_utils:utils",
86f6603c60Sopenharmony_ci    "huks:libhukssdk",
87f6603c60Sopenharmony_ci  ]
88f6603c60Sopenharmony_ci  deps = [
89f6603c60Sopenharmony_ci    "$base_root/base/security/huks/frameworks/huks_standard/main:huks_standard_frameworks",
90f6603c60Sopenharmony_ci    "$base_root/base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static",
91f6603c60Sopenharmony_ci    "$base_root/base/security/huks/interfaces/kits/c:huks_ndk",
92f6603c60Sopenharmony_ci    "$base_root/third_party/bounds_checking_function:libsec_static",
93f6603c60Sopenharmony_ci    "$base_root/third_party/openssl:libcrypto_shared",
94f6603c60Sopenharmony_ci  ]
95f6603c60Sopenharmony_ci}
96