1# Copyright (C) 2022-2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/security/crypto_framework/common/common.gni")
15import("//base/security/crypto_framework/frameworks/frameworks.gni")
16import("//build/ohos.gni")
17
18ohos_shared_library("cryptoframework_napi") {
19  branch_protector_ret = "pac_ret"
20  subsystem_name = "security"
21  part_name = "crypto_framework"
22  relative_install_dir = "module/security"
23  include_dirs =
24      [ "//base/security/crypto_framework/frameworks/js/napi/crypto/inc" ]
25  include_dirs += framework_inc_path
26
27  if (os_level == "standard") {
28    sanitize = {
29      cfi = true
30      cfi_cross_dso = true
31      debug = false
32    }
33  }
34
35  cflags = [
36    "-DHILOG_ENABLE",
37    "-fPIC",
38    "-g3",
39  ]
40
41  sources = [
42    "src/napi_asy_key_generator.cpp",
43    "src/napi_asy_key_spec_generator.cpp",
44    "src/napi_cipher.cpp",
45    "src/napi_dh_key_util.cpp",
46    "src/napi_ecc_key_util.cpp",
47    "src/napi_init.cpp",
48    "src/napi_kdf.cpp",
49    "src/napi_key.cpp",
50    "src/napi_key_agreement.cpp",
51    "src/napi_key_pair.cpp",
52    "src/napi_mac.cpp",
53    "src/napi_md.cpp",
54    "src/napi_pri_key.cpp",
55    "src/napi_pub_key.cpp",
56    "src/napi_rand.cpp",
57    "src/napi_sign.cpp",
58    "src/napi_sm2_crypto_util.cpp",
59    "src/napi_sym_key.cpp",
60    "src/napi_sym_key_generator.cpp",
61    "src/napi_utils.cpp",
62    "src/napi_verify.cpp",
63  ]
64
65  deps = [ "//base/security/crypto_framework/frameworks:crypto_framework_lib" ]
66
67  external_deps = [
68    "bounds_checking_function:libsec_shared",
69    "hilog:libhilog",
70    "napi:ace_napi",
71  ]
72}
73