From 9f3f671a6d54ee494b67a7009658405626595c6e Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 17 Oct 2024 17:51:21 +0200 Subject: [PATCH] bt: mesh: remove TinyCrypt support As part of the deprecation process of TinyCrypt in Zephyr codebase (#79566) this commit removes TinyCrypt support from BT mesh. Signed-off-by: Valerio Setti --- include/zephyr/bluetooth/mesh/keys.h | 8 - .../bap_broadcast_assistant/prj.conf | 2 +- samples/bluetooth/bap_broadcast_sink/prj.conf | 2 +- .../bap_unicast_client/boards/native_sim.conf | 2 +- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340bsim_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../bap_unicast_server/boards/native_sim.conf | 2 +- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340bsim_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../bluetooth/hap_ha/boards/native_sim.conf | 2 +- samples/bluetooth/hci_spi/prj.conf | 2 +- samples/bluetooth/hci_uart/prj.conf | 2 +- samples/bluetooth/hci_uart_3wire/prj.conf | 2 +- samples/bluetooth/peripheral_esp/prj.conf | 1 - .../boards/tlsr9518adk80d.conf | 2 +- samples/bluetooth/peripheral_sc_only/prj.conf | 2 +- .../tmap_bmr/boards/native_posix.conf | 2 +- .../bluetooth/tmap_bmr/boards/native_sim.conf | 2 +- .../tmap_bms/boards/native_posix.conf | 2 +- .../bluetooth/tmap_bms/boards/native_sim.conf | 2 +- .../tmap_central/boards/native_posix.conf | 2 +- .../tmap_central/boards/native_sim.conf | 2 +- .../tmap_peripheral/boards/native_posix.conf | 2 +- .../tmap_peripheral/boards/native_sim.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../onoff_level_lighting_vnd_app/prj.conf | 2 +- subsys/bluetooth/common/Kconfig | 3 +- subsys/bluetooth/mesh/CMakeLists.txt | 6 +- subsys/bluetooth/mesh/Kconfig | 17 +- subsys/bluetooth/mesh/crypto_tc.c | 156 ------------------ subsys/bluetooth/mesh/keys.h | 34 ---- subsys/testsuite/include/zephyr/test_utils.h | 85 ---------- tests/bluetooth/host/crypto/CMakeLists.txt | 1 - tests/bluetooth/init/prj_10.conf | 2 +- tests/bluetooth/init/prj_11.conf | 2 +- tests/bluetooth/init/prj_12.conf | 2 +- tests/bluetooth/init/prj_13.conf | 2 +- tests/bluetooth/init/prj_14.conf | 2 +- tests/bluetooth/init/prj_15.conf | 2 +- tests/bluetooth/init/prj_17.conf | 2 +- tests/bluetooth/init/prj_20.conf | 2 +- tests/bluetooth/init/prj_21.conf | 2 +- tests/bluetooth/init/prj_9.conf | 2 +- tests/bluetooth/init/prj_ctlr.conf | 2 +- tests/bluetooth/init/prj_ctlr_5_x_dbg.conf | 2 +- tests/bluetooth/init/prj_ctlr_dbg.conf | 2 +- tests/bluetooth/init/prj_ctlr_ticker.conf | 2 +- tests/bluetooth/init/prj_ctlr_tiny.conf | 2 +- tests/bluetooth/init/prj_llcp.conf | 2 +- tests/bluetooth/mesh/brg/CMakeLists.txt | 2 +- .../mesh/delayable_msg/CMakeLists.txt | 2 +- tests/bluetooth/mesh/rpl/CMakeLists.txt | 2 +- .../nrf5340_audio_dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- tests/bsim/bluetooth/audio/prj.conf | 2 +- .../boards/nrf5340bsim_nrf5340_cpuapp.conf | 2 +- .../bsim/bluetooth/mesh/src/test_provision.c | 12 -- 64 files changed, 58 insertions(+), 373 deletions(-) delete mode 100644 subsys/bluetooth/mesh/crypto_tc.c delete mode 100644 subsys/testsuite/include/zephyr/test_utils.h diff --git a/include/zephyr/bluetooth/mesh/keys.h b/include/zephyr/bluetooth/mesh/keys.h index 73e0a8a2a938388..9c47c47cfd57b25 100644 --- a/include/zephyr/bluetooth/mesh/keys.h +++ b/include/zephyr/bluetooth/mesh/keys.h @@ -28,14 +28,6 @@ struct bt_mesh_key { psa_key_id_t key; }; -#elif defined CONFIG_BT_MESH_USES_TINYCRYPT - -/** The structure that keeps representation of key. */ -struct bt_mesh_key { - /** tinycrypt key representation is the pure key value. */ - uint8_t key[16]; -}; - #else #error "Crypto library has not been chosen" #endif diff --git a/samples/bluetooth/bap_broadcast_assistant/prj.conf b/samples/bluetooth/bap_broadcast_assistant/prj.conf index 8880c02eaf1a9d4..4404985817a325e 100644 --- a/samples/bluetooth/bap_broadcast_assistant/prj.conf +++ b/samples/bluetooth/bap_broadcast_assistant/prj.conf @@ -7,7 +7,7 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_EXT_ADV=y CONFIG_BT_BAP_BASS_MAX_SUBGROUPS=2 diff --git a/samples/bluetooth/bap_broadcast_sink/prj.conf b/samples/bluetooth/bap_broadcast_sink/prj.conf index 728c2a9f2cdcc4b..54b001f64b8202d 100644 --- a/samples/bluetooth/bap_broadcast_sink/prj.conf +++ b/samples/bluetooth/bap_broadcast_sink/prj.conf @@ -17,4 +17,4 @@ CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_DEVICE_NAME="Broadcast Audio Sink" -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/bap_unicast_client/boards/native_sim.conf b/samples/bluetooth/bap_unicast_client/boards/native_sim.conf index 3d06b9f321f3d30..e6501934ccb0d3f 100644 --- a/samples/bluetooth/bap_unicast_client/boards/native_sim.conf +++ b/samples/bluetooth/bap_unicast_client/boards/native_sim.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/bap_unicast_client/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/bap_unicast_client/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index f28300b84c50e97..a13ac31ca76e7f9 100644 --- a/samples/bluetooth/bap_unicast_client/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/bap_unicast_client/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -10,4 +10,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf b/samples/bluetooth/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf index 7c6a3aecc26875d..a8b30a1dfb7a2ad 100644 --- a/samples/bluetooth/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ b/samples/bluetooth/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -7,4 +7,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/bap_unicast_client/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/bap_unicast_client/boards/nrf5340dk_nrf5340_cpuapp.conf index 76df8dba27a4f45..8f900b85de38b59 100644 --- a/samples/bluetooth/bap_unicast_client/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/bap_unicast_client/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -10,4 +10,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/bap_unicast_server/boards/native_sim.conf b/samples/bluetooth/bap_unicast_server/boards/native_sim.conf index 3d06b9f321f3d30..e6501934ccb0d3f 100644 --- a/samples/bluetooth/bap_unicast_server/boards/native_sim.conf +++ b/samples/bluetooth/bap_unicast_server/boards/native_sim.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/bap_unicast_server/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/bap_unicast_server/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 7c6a3aecc26875d..a8b30a1dfb7a2ad 100644 --- a/samples/bluetooth/bap_unicast_server/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/bap_unicast_server/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -7,4 +7,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/bap_unicast_server/boards/nrf5340bsim_nrf5340_cpuapp.conf b/samples/bluetooth/bap_unicast_server/boards/nrf5340bsim_nrf5340_cpuapp.conf index 7c6a3aecc26875d..a8b30a1dfb7a2ad 100644 --- a/samples/bluetooth/bap_unicast_server/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ b/samples/bluetooth/bap_unicast_server/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -7,4 +7,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/bap_unicast_server/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/bap_unicast_server/boards/nrf5340dk_nrf5340_cpuapp.conf index 76df8dba27a4f45..8f900b85de38b59 100644 --- a/samples/bluetooth/bap_unicast_server/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/bap_unicast_server/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -10,4 +10,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/cap_acceptor/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/cap_acceptor/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 96dc0eb4e3b2cf7..a701419ed6c67cf 100644 --- a/samples/bluetooth/cap_acceptor/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/cap_acceptor/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -3,4 +3,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/cap_acceptor/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/cap_acceptor/boards/nrf5340dk_nrf5340_cpuapp.conf index 96dc0eb4e3b2cf7..a701419ed6c67cf 100644 --- a/samples/bluetooth/cap_acceptor/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/cap_acceptor/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -3,4 +3,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/cap_initiator/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/cap_initiator/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 96dc0eb4e3b2cf7..a701419ed6c67cf 100644 --- a/samples/bluetooth/cap_initiator/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/cap_initiator/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -3,4 +3,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/cap_initiator/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/cap_initiator/boards/nrf5340dk_nrf5340_cpuapp.conf index 96dc0eb4e3b2cf7..a701419ed6c67cf 100644 --- a/samples/bluetooth/cap_initiator/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/cap_initiator/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -3,4 +3,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/samples/bluetooth/hap_ha/boards/native_sim.conf b/samples/bluetooth/hap_ha/boards/native_sim.conf index abce1c1111e5db2..de5da13ed2ec8b6 100644 --- a/samples/bluetooth/hap_ha/boards/native_sim.conf +++ b/samples/bluetooth/hap_ha/boards/native_sim.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y # For LE-audio at 10ms intervals we need the tick counter to occur more frequently # than every 10 ms as each PDU for some reason takes 2 ticks to process. diff --git a/samples/bluetooth/hci_spi/prj.conf b/samples/bluetooth/hci_spi/prj.conf index 65ce21c799cf4d2..b26b0c2acd11c7e 100644 --- a/samples/bluetooth/hci_spi/prj.conf +++ b/samples/bluetooth/hci_spi/prj.conf @@ -5,7 +5,7 @@ CONFIG_MAIN_STACK_SIZE=512 CONFIG_BT=y CONFIG_BT_HCI_RAW=y CONFIG_BT_MAX_CONN=16 -CONFIG_BT_TINYCRYPT_ECC=n +CONFIG_BT_HCI_ECC=n # Workaround: Unable to allocate command buffer when using K_NO_WAIT since # Host number of completed commands does not follow normal flow control. diff --git a/samples/bluetooth/hci_uart/prj.conf b/samples/bluetooth/hci_uart/prj.conf index bdc73dd68e2e044..9ffdee1f70d514f 100644 --- a/samples/bluetooth/hci_uart/prj.conf +++ b/samples/bluetooth/hci_uart/prj.conf @@ -13,7 +13,7 @@ CONFIG_BT_BUF_CMD_TX_SIZE=255 CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255 CONFIG_BT_CTLR_ASSERT_HANDLER=y CONFIG_BT_MAX_CONN=16 -CONFIG_BT_TINYCRYPT_ECC=n +CONFIG_BT_HCI_ECC=n CONFIG_BT_CTLR_DTM_HCI=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 diff --git a/samples/bluetooth/hci_uart_3wire/prj.conf b/samples/bluetooth/hci_uart_3wire/prj.conf index 02f16a24138b392..d5f3678a7bb6571 100644 --- a/samples/bluetooth/hci_uart_3wire/prj.conf +++ b/samples/bluetooth/hci_uart_3wire/prj.conf @@ -12,7 +12,7 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_CMD_TX_SIZE=255 CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255 CONFIG_BT_MAX_CONN=16 -CONFIG_BT_TINYCRYPT_ECC=n +CONFIG_BT_HCI_ECC=n CONFIG_BT_CTLR_DTM_HCI=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 diff --git a/samples/bluetooth/peripheral_esp/prj.conf b/samples/bluetooth/peripheral_esp/prj.conf index 70f9b5d27e2f995..fd13ca2f3e428b9 100644 --- a/samples/bluetooth/peripheral_esp/prj.conf +++ b/samples/bluetooth/peripheral_esp/prj.conf @@ -1,7 +1,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y -CONFIG_TINYCRYPT=y CONFIG_BT_DEVICE_NAME="ESP peripheral" CONFIG_BT_DIS=y CONFIG_BT_DIS_PNP=n diff --git a/samples/bluetooth/peripheral_sc_only/boards/tlsr9518adk80d.conf b/samples/bluetooth/peripheral_sc_only/boards/tlsr9518adk80d.conf index 04d0a95bd895e80..1c1780106347498 100644 --- a/samples/bluetooth/peripheral_sc_only/boards/tlsr9518adk80d.conf +++ b/samples/bluetooth/peripheral_sc_only/boards/tlsr9518adk80d.conf @@ -1,4 +1,4 @@ # Copyright (c) 2022 Telink Semiconductor # SPDX-License-Identifier: Apache-2.0 -CONFIG_BT_TINYCRYPT_ECC=n +CONFIG_BT_HCI_ECC=n diff --git a/samples/bluetooth/peripheral_sc_only/prj.conf b/samples/bluetooth/peripheral_sc_only/prj.conf index c43abee996dca40..6245c5aa433b4d4 100644 --- a/samples/bluetooth/peripheral_sc_only/prj.conf +++ b/samples/bluetooth/peripheral_sc_only/prj.conf @@ -7,6 +7,6 @@ CONFIG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_MAX_PAIRED=2 CONFIG_BT_DEVICE_NAME="SC only peripheral" diff --git a/samples/bluetooth/tmap_bmr/boards/native_posix.conf b/samples/bluetooth/tmap_bmr/boards/native_posix.conf index 3d06b9f321f3d30..e6501934ccb0d3f 100644 --- a/samples/bluetooth/tmap_bmr/boards/native_posix.conf +++ b/samples/bluetooth/tmap_bmr/boards/native_posix.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/tmap_bmr/boards/native_sim.conf b/samples/bluetooth/tmap_bmr/boards/native_sim.conf index e06b29993819415..e0532e7be8274ab 100644 --- a/samples/bluetooth/tmap_bmr/boards/native_sim.conf +++ b/samples/bluetooth/tmap_bmr/boards/native_sim.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/tmap_bms/boards/native_posix.conf b/samples/bluetooth/tmap_bms/boards/native_posix.conf index 3d06b9f321f3d30..e6501934ccb0d3f 100644 --- a/samples/bluetooth/tmap_bms/boards/native_posix.conf +++ b/samples/bluetooth/tmap_bms/boards/native_posix.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/tmap_bms/boards/native_sim.conf b/samples/bluetooth/tmap_bms/boards/native_sim.conf index e06b29993819415..e0532e7be8274ab 100644 --- a/samples/bluetooth/tmap_bms/boards/native_sim.conf +++ b/samples/bluetooth/tmap_bms/boards/native_sim.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/tmap_central/boards/native_posix.conf b/samples/bluetooth/tmap_central/boards/native_posix.conf index 3d06b9f321f3d30..e6501934ccb0d3f 100644 --- a/samples/bluetooth/tmap_central/boards/native_posix.conf +++ b/samples/bluetooth/tmap_central/boards/native_posix.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/tmap_central/boards/native_sim.conf b/samples/bluetooth/tmap_central/boards/native_sim.conf index e06b29993819415..e0532e7be8274ab 100644 --- a/samples/bluetooth/tmap_central/boards/native_sim.conf +++ b/samples/bluetooth/tmap_central/boards/native_sim.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/tmap_peripheral/boards/native_posix.conf b/samples/bluetooth/tmap_peripheral/boards/native_posix.conf index 3d06b9f321f3d30..e6501934ccb0d3f 100644 --- a/samples/bluetooth/tmap_peripheral/boards/native_posix.conf +++ b/samples/bluetooth/tmap_peripheral/boards/native_posix.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/bluetooth/tmap_peripheral/boards/native_sim.conf b/samples/bluetooth/tmap_peripheral/boards/native_sim.conf index e06b29993819415..e0532e7be8274ab 100644 --- a/samples/bluetooth/tmap_peripheral/boards/native_sim.conf +++ b/samples/bluetooth/tmap_peripheral/boards/native_sim.conf @@ -1,5 +1,5 @@ CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_LIBLC3=y CONFIG_FPU=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index e6f744fb95ab2f8..a20ffffe7821112 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -27,7 +27,7 @@ CONFIG_BT_CTLR_PRIVACY=n CONFIG_BT_PERIPHERAL=y CONFIG_BT=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_L2CAP_TX_BUF_COUNT=8 CONFIG_BT_MESH=y diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index f23b4dc2a304b98..bbe322eb6a7d7f3 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -22,7 +22,7 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y CONFIG_BT_PERIPHERAL=y CONFIG_BT=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_RX_STACK_SIZE=4096 CONFIG_BT_L2CAP_TX_BUF_COUNT=8 diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 8bec5ba90d5d886..a5fde079b7df398 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -231,8 +231,7 @@ config BT_WAIT_NOP config BT_RPA bool - select TINYCRYPT - select TINYCRYPT_AES + depends on BT_HOST_CRYPTO || BT_CTLR_CRYPTO config BT_ASSERT bool "Custom Bluetooth assert implementation" diff --git a/subsys/bluetooth/mesh/CMakeLists.txt b/subsys/bluetooth/mesh/CMakeLists.txt index 3d5deadc6d92dc6..6b76809cb1d2cb0 100644 --- a/subsys/bluetooth/mesh/CMakeLists.txt +++ b/subsys/bluetooth/mesh/CMakeLists.txt @@ -123,11 +123,7 @@ zephyr_library_sources_ifdef(CONFIG_BT_MESH_STATISTIC statistic.c) zephyr_library_sources_ifdef(CONFIG_BT_MESH_ACCESS_DELAYABLE_MSG delayable_msg.c) -if (CONFIG_BT_MESH_USES_TINYCRYPT) - zephyr_library_sources(crypto_tc.c) -else() - zephyr_library_sources(crypto_psa.c) -endif() +zephyr_library_sources(crypto_psa.c) zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 384033f79083e84..e844fc365a8afa5 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1399,30 +1399,17 @@ endmenu # Proxy choice BT_MESH_CRYPTO_LIB prompt "Crypto library:" default BT_MESH_USES_TFM_PSA if BUILD_WITH_TFM - default BT_MESH_USES_TINYCRYPT + default BT_MESH_USES_MBEDTLS_PSA help Crypto library selection for mesh security. -config BT_MESH_USES_TINYCRYPT - bool "TinyCrypt" - select TINYCRYPT - select TINYCRYPT_AES - select TINYCRYPT_AES_CMAC - select TINYCRYPT_ECC_DH - select TINYCRYPT_SHA256 - select TINYCRYPT_SHA256_HMAC - select BT_HOST_CCM - help - Use TinyCrypt library to perform crypto operations. - config BT_MESH_USES_MBEDTLS_PSA bool "mbed TLS PSA [EXPERIMENTAL]" select EXPERIMENTAL select MBEDTLS + select MBEDTLS_PSA_CRYPTO_C select MBEDTLS_ENTROPY_C select MBEDTLS_ENTROPY_POLL_ZEPHYR - select MBEDTLS_PSA_CRYPTO_C - select MBEDTLS_USE_PSA_CRYPTO select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE diff --git a/subsys/bluetooth/mesh/crypto_tc.c b/subsys/bluetooth/mesh/crypto_tc.c deleted file mode 100644 index 68cc9d14ed03c30..000000000000000 --- a/subsys/bluetooth/mesh/crypto_tc.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2017 Intel Corporation - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#define LOG_LEVEL CONFIG_BT_MESH_CRYPTO_LOG_LEVEL -#include -LOG_MODULE_REGISTER(bt_mesh_crypto_tc); - -#include "mesh.h" -#include "crypto.h" -#include "prov.h" - -static struct { - bool is_ready; - uint8_t private_key_be[PRIV_KEY_SIZE]; - uint8_t public_key_be[PUB_KEY_SIZE]; -} dh_pair; - -int bt_mesh_encrypt(const struct bt_mesh_key *key, const uint8_t plaintext[16], - uint8_t enc_data[16]) -{ - return bt_encrypt_be(key->key, plaintext, enc_data); -} - -int bt_mesh_ccm_encrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *plaintext, - size_t len, const uint8_t *aad, size_t aad_len, uint8_t *enc_data, - size_t mic_size) -{ - return bt_ccm_encrypt(key->key, nonce, plaintext, len, aad, aad_len, enc_data, mic_size); -} - -int bt_mesh_ccm_decrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *enc_data, - size_t len, const uint8_t *aad, size_t aad_len, uint8_t *plaintext, - size_t mic_size) -{ - return bt_ccm_decrypt(key->key, nonce, enc_data, len, aad, aad_len, plaintext, mic_size); -} - -int bt_mesh_aes_cmac_raw_key(const uint8_t key[16], struct bt_mesh_sg *sg, size_t sg_len, - uint8_t mac[16]) -{ - struct tc_aes_key_sched_struct sched; - struct tc_cmac_struct state; - - if (tc_cmac_setup(&state, key, &sched) == TC_CRYPTO_FAIL) { - return -EIO; - } - - for (; sg_len; sg_len--, sg++) { - if (tc_cmac_update(&state, sg->data, sg->len) == TC_CRYPTO_FAIL) { - return -EIO; - } - } - - if (tc_cmac_final(mac, &state) == TC_CRYPTO_FAIL) { - return -EIO; - } - - return 0; -} - -int bt_mesh_aes_cmac_mesh_key(const struct bt_mesh_key *key, struct bt_mesh_sg *sg, - size_t sg_len, uint8_t mac[16]) -{ - return bt_mesh_aes_cmac_raw_key(key->key, sg, sg_len, mac); -} - -int bt_mesh_sha256_hmac_raw_key(const uint8_t key[32], struct bt_mesh_sg *sg, size_t sg_len, - uint8_t mac[32]) -{ - struct tc_hmac_state_struct h; - - if (tc_hmac_set_key(&h, key, 32) == TC_CRYPTO_FAIL) { - return -EIO; - } - - if (tc_hmac_init(&h) == TC_CRYPTO_FAIL) { - return -EIO; - } - - for (; sg_len; sg_len--, sg++) { - if (tc_hmac_update(&h, sg->data, sg->len) == TC_CRYPTO_FAIL) { - return -EIO; - } - } - - if (tc_hmac_final(mac, 32, &h) == TC_CRYPTO_FAIL) { - return -EIO; - } - - return 0; -} - -int bt_mesh_pub_key_gen(void) -{ - int rc = uECC_make_key(dh_pair.public_key_be, - dh_pair.private_key_be, - &curve_secp256r1); - - if (rc == TC_CRYPTO_FAIL) { - dh_pair.is_ready = false; - LOG_ERR("Failed to create public/private pair"); - return -EIO; - } - - dh_pair.is_ready = true; - - return 0; -} - -const uint8_t *bt_mesh_pub_key_get(void) -{ - return dh_pair.is_ready ? dh_pair.public_key_be : NULL; -} - -int bt_mesh_dhkey_gen(const uint8_t *pub_key, const uint8_t *priv_key, uint8_t *dhkey) -{ - if (uECC_valid_public_key(pub_key, &curve_secp256r1)) { - LOG_ERR("Public key is not valid"); - return -EIO; - } else if (uECC_shared_secret(pub_key, priv_key ? priv_key : - dh_pair.private_key_be, - dhkey, &curve_secp256r1) != TC_CRYPTO_SUCCESS) { - LOG_ERR("DHKey generation failed"); - return -EIO; - } - - return 0; -} - -__weak int default_CSPRNG(uint8_t *dst, unsigned int len) -{ - return !bt_rand(dst, len); -} - -int bt_mesh_crypto_init(void) -{ - return 0; -} diff --git a/subsys/bluetooth/mesh/keys.h b/subsys/bluetooth/mesh/keys.h index a72236e46783124..b04e4f11bcbe337 100644 --- a/subsys/bluetooth/mesh/keys.h +++ b/subsys/bluetooth/mesh/keys.h @@ -13,42 +13,8 @@ enum bt_mesh_key_type { BT_MESH_KEY_TYPE_DEV }; -#if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA - int bt_mesh_key_import(enum bt_mesh_key_type type, const uint8_t in[16], struct bt_mesh_key *out); int bt_mesh_key_export(uint8_t out[16], const struct bt_mesh_key *in); void bt_mesh_key_assign(struct bt_mesh_key *dst, const struct bt_mesh_key *src); int bt_mesh_key_destroy(const struct bt_mesh_key *key); int bt_mesh_key_compare(const uint8_t raw_key[16], const struct bt_mesh_key *mesh_key); - -#elif defined CONFIG_BT_MESH_USES_TINYCRYPT - -static inline int bt_mesh_key_import(enum bt_mesh_key_type type, const uint8_t in[16], - struct bt_mesh_key *out) -{ - memcpy(out, in, 16); - return 0; -} - -static inline int bt_mesh_key_export(uint8_t out[16], const struct bt_mesh_key *in) -{ - memcpy(out, in, 16); - return 0; -} - -static inline void bt_mesh_key_assign(struct bt_mesh_key *dst, const struct bt_mesh_key *src) -{ - memcpy(dst, src, sizeof(struct bt_mesh_key)); -} - -static inline int bt_mesh_key_destroy(const struct bt_mesh_key *key) -{ - return 0; -} - -static inline int bt_mesh_key_compare(const uint8_t raw_key[16], const struct bt_mesh_key *mesh_key) -{ - return memcmp(mesh_key, raw_key, 16); -} - -#endif diff --git a/subsys/testsuite/include/zephyr/test_utils.h b/subsys/testsuite/include/zephyr/test_utils.h deleted file mode 100644 index 110d0306e31f88f..000000000000000 --- a/subsys/testsuite/include/zephyr/test_utils.h +++ /dev/null @@ -1,85 +0,0 @@ -/* test_utils.h - TinyCrypt interface to common functions for tests */ - -/* - * Copyright (C) 2015 by Intel Corporation, All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __TEST_UTILS_H__ -#define __TEST_UTILS_H__ - -#include -#include - -static inline void show_str(const char *label, const uint8_t *s, size_t len) -{ - uint32_t i; - - TC_PRINT("%s = ", label); - for (i = 0U; i < (uint32_t)len; ++i) { - TC_PRINT("%02x", s[i]); - } - TC_PRINT("\n"); -} - -static inline -void fatal(uint32_t testnum, const void *expected, size_t expectedlen, - const void *computed, size_t computedlen) -{ - TC_ERROR("\tTest #%d Failed!\n", testnum); - show_str("\t\tExpected", expected, expectedlen); - show_str("\t\tComputed ", computed, computedlen); - TC_PRINT("\n"); -} - -static inline -uint32_t check_result(uint32_t testnum, const void *expected, - size_t expectedlen, const void *computed, - size_t computedlen, uint32_t verbose) -{ - uint32_t result = TC_PASS; - - ARG_UNUSED(verbose); - - if (expectedlen != computedlen) { - TC_ERROR("The length of the computed buffer (%zu)", - computedlen); - TC_ERROR("does not match the expected length (%zu).", - expectedlen); - result = TC_FAIL; - } else { - if (memcmp(computed, expected, computedlen) != 0) { - fatal(testnum, expected, expectedlen, - computed, computedlen); - result = TC_FAIL; - } - } - - return result; -} - -#endif diff --git a/tests/bluetooth/host/crypto/CMakeLists.txt b/tests/bluetooth/host/crypto/CMakeLists.txt index 856b27562822aad..9b65593d5707a6a 100644 --- a/tests/bluetooth/host/crypto/CMakeLists.txt +++ b/tests/bluetooth/host/crypto/CMakeLists.txt @@ -24,7 +24,6 @@ target_include_directories(mocks PUBLIC ${ZEPHYR_BASE}/subsys/bluetooth/host ${ZEPHYR_BASE}/tests/bluetooth/host ${ZEPHYR_BASE}/tests/bluetooth/host/crypto/mocks - ${ZEPHYR_BASE}/../modules/crypto/tinycrypt/lib/include ) target_link_libraries(mocks PRIVATE test_interface) diff --git a/tests/bluetooth/init/prj_10.conf b/tests/bluetooth/init/prj_10.conf index 6aca73579723424..ccba7b169cc657b 100644 --- a/tests/bluetooth/init/prj_10.conf +++ b/tests/bluetooth/init/prj_10.conf @@ -4,6 +4,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_11.conf b/tests/bluetooth/init/prj_11.conf index 6b46c845df81f7a..cb2d237f951f61d 100644 --- a/tests/bluetooth/init/prj_11.conf +++ b/tests/bluetooth/init/prj_11.conf @@ -4,7 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_12.conf b/tests/bluetooth/init/prj_12.conf index 55111c5b28811fa..1fe32d6f2106ad2 100644 --- a/tests/bluetooth/init/prj_12.conf +++ b/tests/bluetooth/init/prj_12.conf @@ -3,7 +3,7 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_13.conf b/tests/bluetooth/init/prj_13.conf index 0de0be405ce3f82..32f0206fd6edc69 100644 --- a/tests/bluetooth/init/prj_13.conf +++ b/tests/bluetooth/init/prj_13.conf @@ -3,7 +3,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_14.conf b/tests/bluetooth/init/prj_14.conf index a25c48d4bbbc1b5..d73d3478549ba8d 100644 --- a/tests/bluetooth/init/prj_14.conf +++ b/tests/bluetooth/init/prj_14.conf @@ -3,5 +3,5 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_15.conf b/tests/bluetooth/init/prj_15.conf index 3839272ce11a2f7..bc8e262a04f74a2 100644 --- a/tests/bluetooth/init/prj_15.conf +++ b/tests/bluetooth/init/prj_15.conf @@ -3,5 +3,5 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_17.conf b/tests/bluetooth/init/prj_17.conf index 4ee00dca586b630..fdff84468f9c730 100644 --- a/tests/bluetooth/init/prj_17.conf +++ b/tests/bluetooth/init/prj_17.conf @@ -4,7 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_20.conf b/tests/bluetooth/init/prj_20.conf index 43022222067fe87..375832de762c89a 100644 --- a/tests/bluetooth/init/prj_20.conf +++ b/tests/bluetooth/init/prj_20.conf @@ -4,7 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_21.conf b/tests/bluetooth/init/prj_21.conf index 2c0fad1fa136ffe..749853070d7adbf 100644 --- a/tests/bluetooth/init/prj_21.conf +++ b/tests/bluetooth/init/prj_21.conf @@ -4,7 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_9.conf b/tests/bluetooth/init/prj_9.conf index be22972e42d6e24..3a48260f51b4504 100644 --- a/tests/bluetooth/init/prj_9.conf +++ b/tests/bluetooth/init/prj_9.conf @@ -4,5 +4,5 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_ctlr.conf b/tests/bluetooth/init/prj_ctlr.conf index 3b5ba787a0f2190..1ddb074a196ca2b 100644 --- a/tests/bluetooth/init/prj_ctlr.conf +++ b/tests/bluetooth/init/prj_ctlr.conf @@ -7,7 +7,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_BT_CLASSIC=n diff --git a/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf b/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf index 920a9f088609ec8..7c148c533348259 100644 --- a/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf @@ -59,7 +59,7 @@ CONFIG_BT_ISO_PERIPHERAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_dbg.conf b/tests/bluetooth/init/prj_ctlr_dbg.conf index 386e81a33f91927..7985f444d9954a3 100644 --- a/tests/bluetooth/init/prj_ctlr_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_dbg.conf @@ -42,7 +42,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_ticker.conf b/tests/bluetooth/init/prj_ctlr_ticker.conf index 47c4f3f70629d9c..e083df70746ed3b 100644 --- a/tests/bluetooth/init/prj_ctlr_ticker.conf +++ b/tests/bluetooth/init/prj_ctlr_ticker.conf @@ -42,7 +42,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_tiny.conf b/tests/bluetooth/init/prj_ctlr_tiny.conf index a9dcf2327e05a74..9f0456ca6ffd267 100644 --- a/tests/bluetooth/init/prj_ctlr_tiny.conf +++ b/tests/bluetooth/init/prj_ctlr_tiny.conf @@ -35,7 +35,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_BT_CLASSIC=n diff --git a/tests/bluetooth/init/prj_llcp.conf b/tests/bluetooth/init/prj_llcp.conf index 05eb2197c1d6474..91c77a50b54043a 100644 --- a/tests/bluetooth/init/prj_llcp.conf +++ b/tests/bluetooth/init/prj_llcp.conf @@ -7,7 +7,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_BT_CLASSIC=n diff --git a/tests/bluetooth/mesh/brg/CMakeLists.txt b/tests/bluetooth/mesh/brg/CMakeLists.txt index d878ad04d50fd68..aa140c39c222fd3 100644 --- a/tests/bluetooth/mesh/brg/CMakeLists.txt +++ b/tests/bluetooth/mesh/brg/CMakeLists.txt @@ -19,4 +19,4 @@ target_compile_options(app -DCONFIG_BT_SETTINGS -DCONFIG_BT_MESH_BRG_CFG_SRV -DCONFIG_BT_MESH_BRG_TABLE_ITEMS_MAX=16 - -DCONFIG_BT_MESH_USES_TINYCRYPT) + -DCONFIG_BT_MESH_USES_MBEDTLS_PSA) diff --git a/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt b/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt index 51bf28d832003fc..9c10285f0555fc7 100644 --- a/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt +++ b/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt @@ -20,4 +20,4 @@ target_compile_options(app -DCONFIG_BT_MESH_ACCESS_DELAYABLE_MSG_COUNT=4 -DCONFIG_BT_MESH_ACCESS_DELAYABLE_MSG_CHUNK_SIZE=20 -DCONFIG_BT_MESH_ACCESS_DELAYABLE_MSG_CHUNK_COUNT=20 - -DCONFIG_BT_MESH_USES_TINYCRYPT) + -DCONFIG_BT_MESH_USES_MBEDTLS_PSA) diff --git a/tests/bluetooth/mesh/rpl/CMakeLists.txt b/tests/bluetooth/mesh/rpl/CMakeLists.txt index b22dcae3e7c8359..17545736a4425b7 100644 --- a/tests/bluetooth/mesh/rpl/CMakeLists.txt +++ b/tests/bluetooth/mesh/rpl/CMakeLists.txt @@ -19,4 +19,4 @@ target_compile_options(app -DCONFIG_BT_MESH_CRPL=10 -DCONFIG_BT_MESH_RPL_STORE_TIMEOUT=1 -DCONFIG_BT_SETTINGS - -DCONFIG_BT_MESH_USES_TINYCRYPT) + -DCONFIG_BT_MESH_USES_MBEDTLS_PSA) diff --git a/tests/bluetooth/shell/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/tests/bluetooth/shell/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf index 68e0a8a7e50f8ec..eb7e3f2f5b2cfc2 100644 --- a/tests/bluetooth/shell/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf +++ b/tests/bluetooth/shell/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -9,4 +9,4 @@ CONFIG_USB_DEVICE_AUDIO=y CONFIG_USB_DEVICE_PRODUCT="Zephyr Shell USB" # Enable encryption in the host -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/tests/bluetooth/shell/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/bluetooth/shell/boards/nrf5340dk_nrf5340_cpuapp.conf index 68e0a8a7e50f8ec..eb7e3f2f5b2cfc2 100644 --- a/tests/bluetooth/shell/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/tests/bluetooth/shell/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -9,4 +9,4 @@ CONFIG_USB_DEVICE_AUDIO=y CONFIG_USB_DEVICE_PRODUCT="Zephyr Shell USB" # Enable encryption in the host -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/tests/bluetooth/tester/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/bluetooth/tester/boards/nrf5340dk_nrf5340_cpuapp.conf index 6f723ffa16015cf..0bd02b4c2142610 100644 --- a/tests/bluetooth/tester/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -22,4 +22,4 @@ CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/tests/bsim/bluetooth/audio/prj.conf b/tests/bsim/bluetooth/audio/prj.conf index fd8f7117c4edb43..a1e17e7e632b86b 100644 --- a/tests/bsim/bluetooth/audio/prj.conf +++ b/tests/bsim/bluetooth/audio/prj.conf @@ -20,7 +20,7 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_EVT_RX_SIZE=255 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y CONFIG_BT_AUDIO=y CONFIG_BT_BAP_UNICAST_SERVER=y diff --git a/tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf index f1624acbc199f56..b8df93bf93b6eeb 100644 --- a/tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ b/tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -9,4 +9,4 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_CMD_TX_SIZE=255 -CONFIG_BT_TINYCRYPT_ECC=y +CONFIG_BT_HCI_ECC=y diff --git a/tests/bsim/bluetooth/mesh/src/test_provision.c b/tests/bsim/bluetooth/mesh/src/test_provision.c index c7fed00485a17b4..f9bed5e9f740c9a 100644 --- a/tests/bsim/bluetooth/mesh/src/test_provision.c +++ b/tests/bsim/bluetooth/mesh/src/test_provision.c @@ -15,11 +15,6 @@ #if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA #include -#elif defined CONFIG_BT_MESH_USES_TINYCRYPT -#include -#include -#include -#else #error "Unknown crypto library has been chosen" #endif @@ -435,7 +430,6 @@ static void oob_auth_set(int test_step) prov.input_actions = oob_auth_test_vector[test_step].input_actions; } -#if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA static void generate_oob_key_pair(void) { psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT; @@ -470,12 +464,6 @@ static void generate_oob_key_pair(void) memcpy(public_key_be, public_key_repr + 1, 64); } -#elif defined CONFIG_BT_MESH_USES_TINYCRYPT -static void generate_oob_key_pair(void) -{ - ASSERT_TRUE(uECC_make_key(public_key_be, private_key_be, uECC_secp256r1())); -} -#endif static void oob_device(bool use_oob_pk) {