Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Gyorgy Szing | 28bca0b | 2023-02-15 11:17:07 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved. |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | add_components(TARGET "crypto" |
| 9 | BASE_DIR ${TS_ROOT} |
| 10 | COMPONENTS |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 11 | "components/common/tlv" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 12 | "components/rpc/common/interface" |
Imre Kis | bd8011a | 2023-07-04 18:00:39 +0200 | [diff] [blame] | 13 | "components/rpc/common/endpoint" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 14 | "components/service/common/include" |
Gabor Ambrus | 70908d0 | 2023-08-15 14:42:38 +0200 | [diff] [blame] | 15 | "components/service/common/client" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 16 | "components/service/common/serializer/protobuf" |
| 17 | "components/service/common/provider" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 18 | "components/service/crypto/provider" |
| 19 | "components/service/crypto/provider/serializer/protobuf" |
| 20 | "components/service/crypto/provider/serializer/packed-c" |
| 21 | "components/service/crypto/provider/extension/hash" |
| 22 | "components/service/crypto/provider/extension/hash/serializer/packed-c" |
| 23 | "components/service/crypto/provider/extension/cipher" |
| 24 | "components/service/crypto/provider/extension/cipher/serializer/packed-c" |
| 25 | "components/service/crypto/provider/extension/key_derivation" |
| 26 | "components/service/crypto/provider/extension/key_derivation/serializer/packed-c" |
| 27 | "components/service/crypto/provider/extension/mac" |
| 28 | "components/service/crypto/provider/extension/mac/serializer/packed-c" |
Julian Hall | ee8e824 | 2022-02-11 14:24:53 +0000 | [diff] [blame] | 29 | "components/service/crypto/provider/extension/aead" |
| 30 | "components/service/crypto/provider/extension/aead/serializer/packed-c" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 31 | "components/service/crypto/factory/full" |
| 32 | "components/service/crypto/backend/mbedcrypto" |
Gabor Toth | ab7db21 | 2023-08-18 16:08:12 +0200 | [diff] [blame] | 33 | "components/service/crypto/backend/mbedcrypto/mbedtls_fake_x509" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 34 | "protocols/rpc/common/packed-c" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 35 | "protocols/service/crypto/protobuf" |
| 36 | ) |
| 37 | |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 38 | #------------------------------------------------------------------------------- |
| 39 | # Components used from external projects |
| 40 | # |
| 41 | #------------------------------------------------------------------------------- |
| 42 | |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 43 | # Nanopb |
Julian Hall | 64f1d87 | 2022-09-05 16:52:40 +0100 | [diff] [blame] | 44 | include(${TS_ROOT}/external/nanopb/nanopb.cmake) |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 45 | target_link_libraries(crypto PRIVATE nanopb::protobuf-nanopb-static) |
| 46 | protobuf_generate_all(TGT "crypto" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols") |
| 47 | |
| 48 | # Mbed TLS provides libmbedcrypto |
Gabor Toth | ab7db21 | 2023-08-18 16:08:12 +0200 | [diff] [blame] | 49 | set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/libmbedx509.h" |
Julian Hall | a544317 | 2022-05-30 11:52:11 +0100 | [diff] [blame] | 50 | CACHE STRING "Configuration file for Mbed TLS" FORCE) |
Julian Hall | 64f1d87 | 2022-09-05 16:52:40 +0100 | [diff] [blame] | 51 | include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake) |
Balint Dobszay | ff8e0cd | 2022-08-11 15:07:52 +0200 | [diff] [blame] | 52 | target_link_libraries(crypto PRIVATE MbedTLS::mbedcrypto) |
Gabor Toth | ab7db21 | 2023-08-18 16:08:12 +0200 | [diff] [blame] | 53 | target_link_libraries(crypto PRIVATE MbedTLS::mbedx509) |
| 54 | |
| 55 | # Provide the config path to mbedtls |
| 56 | target_compile_definitions(crypto |
| 57 | PRIVATE |
| 58 | MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}" |
| 59 | ) |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 60 | |
| 61 | ################################################################# |
| 62 | |
| 63 | target_include_directories(crypto PRIVATE |
| 64 | ${TS_ROOT} |
| 65 | ${TS_ROOT}/components |
| 66 | ) |