Skip to content

Commit 09e86f3

Browse files
jhedbergkartben
authored andcommitted
Bluetooth: Host: Remove HCI ECC emulation
Remove the HCI command & event emulation layer for ECDH commands and events. This means that we always do the necessary operations in the host. The existing BT_ECC Kconfig option stays, but now gets automatically enabled when necessary (e.g. based on the BT_SMP option), which is why this commit removes so many explicit assignments in prj.conf files. Signed-off-by: Johan Hedberg <[email protected]>
1 parent 020cb79 commit 09e86f3

File tree

67 files changed

+196
-675
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+196
-675
lines changed

samples/bluetooth/bap_broadcast_assistant/prj.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255
1010
CONFIG_BT_BUF_ACL_TX_SIZE=251
1111
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191
1212

13-
CONFIG_BT_SEND_ECC_EMULATION=y
14-
1513
CONFIG_BT_EXT_ADV=y
1614
CONFIG_BT_PER_ADV_SYNC=y
1715
CONFIG_BT_BAP_BASS_MAX_SUBGROUPS=2

samples/bluetooth/bap_broadcast_sink/prj.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE=64
2525
CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE=64
2626

2727
CONFIG_BT_DEVICE_NAME="Broadcast Audio Sink"
28-
29-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/bap_unicast_client/boards/native_sim.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/bap_unicast_client/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
99
CONFIG_BT_BUF_ACL_RX_SIZE=255
1010
CONFIG_BT_BUF_ACL_TX_SIZE=251
1111
CONFIG_BT_BUF_CMD_TX_SIZE=255
12-
13-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/bap_unicast_client/boards/nrf5340bsim_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
66
CONFIG_BT_BUF_ACL_RX_SIZE=255
77
CONFIG_BT_BUF_ACL_TX_SIZE=251
88
CONFIG_BT_BUF_CMD_TX_SIZE=255
9-
10-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/bap_unicast_client/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
99
CONFIG_BT_BUF_ACL_RX_SIZE=255
1010
CONFIG_BT_BUF_ACL_TX_SIZE=251
1111
CONFIG_BT_BUF_CMD_TX_SIZE=255
12-
13-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/bap_unicast_server/boards/native_sim.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/bap_unicast_server/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
66
CONFIG_BT_BUF_ACL_RX_SIZE=255
77
CONFIG_BT_BUF_ACL_TX_SIZE=251
88
CONFIG_BT_BUF_CMD_TX_SIZE=255
9-
10-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/bap_unicast_server/boards/nrf5340bsim_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
66
CONFIG_BT_BUF_ACL_RX_SIZE=255
77
CONFIG_BT_BUF_ACL_TX_SIZE=251
88
CONFIG_BT_BUF_CMD_TX_SIZE=255
9-
10-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/bap_unicast_server/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
99
CONFIG_BT_BUF_ACL_RX_SIZE=255
1010
CONFIG_BT_BUF_ACL_TX_SIZE=251
1111
CONFIG_BT_BUF_CMD_TX_SIZE=255
12-
13-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/cap_acceptor/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
22
CONFIG_BT_BUF_ACL_RX_SIZE=255
33
CONFIG_BT_BUF_ACL_TX_SIZE=251
44
CONFIG_BT_BUF_CMD_TX_SIZE=255
5-
6-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/cap_acceptor/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
22
CONFIG_BT_BUF_ACL_RX_SIZE=255
33
CONFIG_BT_BUF_ACL_TX_SIZE=251
44
CONFIG_BT_BUF_CMD_TX_SIZE=255
5-
6-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/cap_initiator/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
22
CONFIG_BT_BUF_ACL_RX_SIZE=255
33
CONFIG_BT_BUF_ACL_TX_SIZE=251
44
CONFIG_BT_BUF_CMD_TX_SIZE=255
5-
6-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/cap_initiator/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
22
CONFIG_BT_BUF_ACL_RX_SIZE=255
33
CONFIG_BT_BUF_ACL_TX_SIZE=251
44
CONFIG_BT_BUF_CMD_TX_SIZE=255
5-
6-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/ccp_call_control_server/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
22
CONFIG_BT_BUF_ACL_RX_SIZE=255
33
CONFIG_BT_BUF_ACL_TX_SIZE=251
44
CONFIG_BT_BUF_CMD_TX_SIZE=255
5-
6-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/ccp_call_control_server/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
22
CONFIG_BT_BUF_ACL_RX_SIZE=255
33
CONFIG_BT_BUF_ACL_TX_SIZE=251
44
CONFIG_BT_BUF_CMD_TX_SIZE=255
5-
6-
CONFIG_BT_SEND_ECC_EMULATION=y

samples/bluetooth/hap_ha/boards/native_sim.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
# For LE-audio at 10ms intervals we need the tick counter to occur more frequently
54
# than every 10 ms as each PDU for some reason takes 2 ticks to process.

samples/bluetooth/hci_spi/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ CONFIG_MAIN_STACK_SIZE=512
55
CONFIG_BT=y
66
CONFIG_BT_HCI_RAW=y
77
CONFIG_BT_MAX_CONN=16
8-
CONFIG_BT_SEND_ECC_EMULATION=n
98

109
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
1110
# Host number of completed commands does not follow normal flow control.

samples/bluetooth/hci_uart/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CONFIG_BT_BUF_CMD_TX_SIZE=255
1313
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
1414
CONFIG_BT_CTLR_ASSERT_HANDLER=y
1515
CONFIG_BT_MAX_CONN=16
16-
CONFIG_BT_SEND_ECC_EMULATION=n
1716
CONFIG_BT_CTLR_DTM_HCI=y
1817

1918
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512

samples/bluetooth/hci_uart_3wire/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CONFIG_BT_BUF_ACL_RX_SIZE=255
1212
CONFIG_BT_BUF_CMD_TX_SIZE=255
1313
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
1414
CONFIG_BT_MAX_CONN=16
15-
CONFIG_BT_SEND_ECC_EMULATION=n
1615
CONFIG_BT_CTLR_DTM_HCI=y
1716

1817
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512

samples/bluetooth/peripheral_sc_only/boards/tlsr9518adk80d.conf

Lines changed: 0 additions & 4 deletions
This file was deleted.

samples/bluetooth/peripheral_sc_only/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ CONFIG_LOG=y
77
CONFIG_BT_PERIPHERAL=y
88
CONFIG_BT_SMP=y
99
CONFIG_BT_SMP_SC_ONLY=y
10-
CONFIG_BT_SEND_ECC_EMULATION=y
1110
CONFIG_BT_MAX_PAIRED=2
1211
CONFIG_BT_DEVICE_NAME="SC only peripheral"

samples/bluetooth/tmap_bmr/boards/native_posix.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/tmap_bmr/boards/native_sim.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/tmap_bms/boards/native_posix.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/tmap_bms/boards/native_sim.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/tmap_central/boards/native_posix.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/tmap_central/boards/native_sim.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/tmap_peripheral/boards/native_posix.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/bluetooth/tmap_peripheral/boards/native_sim.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOG_MODE_IMMEDIATE=y
2-
CONFIG_BT_SEND_ECC_EMULATION=y
32

43
CONFIG_LIBLC3=y
54
CONFIG_FPU=y

samples/boards/nordic/mesh/onoff-app/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ CONFIG_BT_CTLR_PRIVACY=n
2929
CONFIG_BT_PERIPHERAL=y
3030

3131
CONFIG_BT=y
32-
CONFIG_BT_SEND_ECC_EMULATION=y
3332
CONFIG_BT_L2CAP_TX_BUF_COUNT=8
3433

3534
CONFIG_BT_MESH=y

samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
2323

2424
CONFIG_BT_PERIPHERAL=y
2525
CONFIG_BT=y
26-
CONFIG_BT_SEND_ECC_EMULATION=y
2726
CONFIG_BT_RX_STACK_SIZE=4096
2827
CONFIG_BT_L2CAP_TX_BUF_COUNT=8
2928

subsys/bluetooth/controller/hci/hci.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include <zephyr/bluetooth/hci_vs.h>
2222
#include <zephyr/bluetooth/buf.h>
2323

24-
#include "../host/hci_ecc.h"
25-
2624
#include "util/util.h"
2725
#include "util/memq.h"
2826
#include "util/mem.h"
@@ -1049,10 +1047,6 @@ static void read_supported_commands(struct net_buf *buf, struct net_buf **evt)
10491047
rp->commands[41] |= BIT(1);
10501048
#endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER */
10511049

1052-
#if defined(CONFIG_BT_HCI_RAW) && defined(CONFIG_BT_SEND_ECC_EMULATION)
1053-
bt_hci_ecc_supported_commands(rp->commands);
1054-
#endif /* CONFIG_BT_HCI_RAW && CONFIG_BT_SEND_ECC_EMULATION */
1055-
10561050
/* LE Read TX Power. */
10571051
rp->commands[38] |= BIT(7);
10581052

subsys/bluetooth/host/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ add_subdirectory_ifdef(CONFIG_BT_SHELL shell)
88

99
zephyr_library_sources_ifdef(CONFIG_BT_HCI_RAW hci_raw.c hci_common.c)
1010
zephyr_library_sources_ifdef(CONFIG_BT_MONITOR monitor.c)
11-
zephyr_library_sources_ifdef(CONFIG_BT_SEND_ECC_EMULATION hci_ecc.c)
1211
zephyr_library_sources_ifdef(CONFIG_BT_SETTINGS settings.c)
1312
zephyr_library_sources_ifdef(CONFIG_BT_HOST_CCM aes_ccm.c)
1413
zephyr_library_sources_ifdef(CONFIG_BT_LONG_WQ long_wq.c)

subsys/bluetooth/host/Kconfig

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config BT_LONG_WQ_STACK_SIZE
1515
# Hidden: Long workqueue stack size. Should be derived from system
1616
# requirements.
1717
int
18-
default 1400 if BT_SEND_ECC_EMULATION
18+
default 1400 if BT_ECC
1919
default 1300 if BT_GATT_CACHING
2020
default 1024
2121

@@ -407,7 +407,7 @@ config BT_SMP
407407
bool "Security Manager Protocol support"
408408
select BT_CRYPTO
409409
select BT_RPA
410-
select BT_ECC
410+
select BT_ECC if !BT_SMP_OOB_LEGACY_PAIR_ONLY
411411
help
412412
This option enables support for the Security Manager Protocol
413413
(SMP), making it possible to pair devices over LE.
@@ -991,36 +991,21 @@ config BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES
991991
format.
992992

993993
endif # BT_DF
994-
endif # BT_HCI_HOST
995994

996995
config BT_ECC
997996
bool "ECDH key generation support"
998-
default y if BT_SMP && !BT_SMP_OOB_LEGACY_PAIR_ONLY
999-
help
1000-
This option adds support for ECDH HCI commands.
1001-
1002-
config BT_SEND_ECC_EMULATION
1003-
bool "Emulate ECDH in the Host using PSA Crypto API library"
1004997
select MBEDTLS if !BUILD_WITH_TFM
1005998
select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
1006999
select PSA_WANT_ALG_ECDH
10071000
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
10081001
select PSA_WANT_ECC_SECP_R1_256
10091002
imply MBEDTLS_PSA_P256M_DRIVER_ENABLED if MBEDTLS_PSA_CRYPTO_C
10101003
select BT_LONG_WQ
1011-
depends on BT_ECC && (BT_HCI_RAW || BT_HCI_HOST)
1012-
default y if HAS_BT_CTLR && !BT_CTLR_ECDH
1013-
help
1014-
If this option is set PSA Crypto API library is used for emulating the
1015-
ECDH HCI commands and events needed by e.g. LE Secure Connections.
1016-
In builds including the BLE Host, if not set the controller crypto is
1017-
used for ECDH and if the controller doesn't support the required HCI
1018-
commands the LE Secure Connections support will be disabled.
1019-
In builds including the HCI Raw interface and the BLE Controller, this
1020-
option injects support for the 2 HCI commands required for LE Secure
1021-
Connections so that Hosts can make use of those. The option defaults
1022-
to enabled for a combined build with Zephyr's own controller, since it
1023-
does not have any special ECC support itself (at least not currently).
1004+
help
1005+
If this option is set PSA Crypto API library is used for performing ECDH
1006+
operations needed e.g. by LE Secure Connections.
1007+
1008+
endif # BT_HCI_HOST
10241009

10251010
config BT_HOST_CCM
10261011
bool "Host side AES-CCM module"

0 commit comments

Comments
 (0)