zephyr/subsys/bluetooth/crypto/CMakeLists.txt
Valerio Setti 9032f8d791 bt-crypto: add option to use PSA APIs instead of TinyCrypt
This commit adds CONFIG_BT_USE_PSA_API to allow the end
user to prefer PSA APIs over TinyCrypt for crypto operations
in bluetooth. Of course, this is possible only if
a PSA provider is available on the system, i.e.
CONFIG_PSA_CRYPTO_CLIENT is set.

This commit also extends tests/bluetooth/bt_crypto adding
a test case for PSA.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-14 15:41:34 +02:00

23 lines
648 B
CMake

# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_sources(bt_crypto.c)
if(CONFIG_BT_USE_PSA_API)
zephyr_library_sources(bt_crypto_psa.c)
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
zephyr_library_include_directories_ifdef(CONFIG_BUILD_WITH_TFM
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/api_ns/interface/include
)
else()
zephyr_library_sources(bt_crypto_tc.c)
endif()
if(CONFIG_BT_CRYPTO_LOG_LEVEL_DBG)
message(WARNING "CONFIG_BT_CRYPTO_LOG_LEVEL_DBG is enabled.
Private security keys such as the Long Term Key will be printed out.
Do not use in production."
)
endif()