1# Copyright (C) 2022 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 subsystem_name = "security" 20 part_name = "crypto_framework" 21 relative_install_dir = "module/security" 22 include_dirs = [ 23 "//base/security/crypto_framework/interfaces/kits/js", 24 "//third_party/bounds_checking_function/include", 25 "//commonlibrary/c_utils/base/include", 26 "//base/security/crypto_framework/frameworks/js/napi/crypto/inc", 27 "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", 28 ] 29 include_dirs += framework_inc_path 30 31 if (os_level == "standard") { 32 sanitize = { 33 cfi = true 34 debug = false 35 blocklist = "//base/security/crypto_framework/cfi_blocklist.txt" 36 } 37 } 38 39 cflags = [ 40 "-DHILOG_ENABLE", 41 "-fPIC", 42 "-g3", 43 ] 44 45 sources = [ 46 "src/napi_asy_key_generator.cpp", 47 "src/napi_cipher.cpp", 48 "src/napi_init.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_sym_key.cpp", 59 "src/napi_sym_key_generator.cpp", 60 "src/napi_utils.cpp", 61 "src/napi_verify.cpp", 62 ] 63 64 deps = [ 65 "//base/security/crypto_framework/frameworks:crypto_framework_lib", 66 "//third_party/bounds_checking_function:libsec_shared", 67 ] 68 69 external_deps = [ 70 "hiviewdfx_hilog_native:libhilog", 71 "napi:ace_napi", 72 ] 73} 74