|
| 1 | +# Copyright (c) 2024 Project CHIP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +import("//build_overrides/chip.gni") |
| 16 | +import("//build_overrides/nlassert.gni") |
| 17 | +import("${chip_root}/build/chip/buildconfig_header.gni") |
| 18 | +import("${chip_root}/src/crypto/crypto.gni") |
| 19 | +import("${chip_root}/src/platform/Infineon/crypto/trustm/args.gni") |
| 20 | + |
| 21 | +if (chip_crypto == "platform") { |
| 22 | + import("//build_overrides/mbedtls.gni") |
| 23 | +} |
| 24 | + |
| 25 | +source_set("public_headers") { |
| 26 | + sources = [] |
| 27 | + |
| 28 | + public_deps = [ |
| 29 | + "${chip_root}/src/crypto", |
| 30 | + "${chip_root}/src/lib/asn1", |
| 31 | + "${chip_root}/src/lib/core", |
| 32 | + "${chip_root}/src/lib/support", |
| 33 | + "${nlassert_root}:nlassert", |
| 34 | + ] |
| 35 | +} |
| 36 | + |
| 37 | +static_library("infineon_crypto_lib") { |
| 38 | + sources = [ |
| 39 | + "CHIPCryptoPALHost.cpp", |
| 40 | + "CHIPCryptoPALHsm_HKDF_trustm.cpp", |
| 41 | + "CHIPCryptoPALHsm_HMAC_trustm.cpp", |
| 42 | + "CHIPCryptoPALHsm_P256_trustm.cpp", |
| 43 | + "CHIPCryptoPALHsm_rng_trustm.cpp", |
| 44 | + "CHIPCryptoPALHsm_utils_trustm.cpp", |
| 45 | + "CHIPCryptoPAL_HostFallBack.cpp", |
| 46 | + "DeviceAttestationCredsExampleTrustM.cpp", |
| 47 | + ] |
| 48 | + |
| 49 | + public_deps = [ ":public_headers" ] |
| 50 | + public_configs = [] |
| 51 | + public_deps += [ "${chip_root}/third_party/infineon/trustm:optiga-trust-m" ] |
| 52 | + public_configs += [ "${chip_root}/third_party/infineon/trustm:trustm_config" ] |
| 53 | + deps = [ "${chip_root}/${infineon_crypto_root}:optiga-trust-m" ] |
| 54 | + external_mbedtls = current_os == "zephyr" |
| 55 | + |
| 56 | + if (!external_mbedtls) { |
| 57 | + public_deps += [ "${mbedtls_root}:mbedtls" ] |
| 58 | + } |
| 59 | + include_dirs = [ |
| 60 | + ".", |
| 61 | + "${chip_root}/src/crypto", |
| 62 | + "${chip_root}/src/platform/Infineon/crypto/trustm", |
| 63 | + ] |
| 64 | +} |
0 commit comments