bluetooth: Make controller crypto functions optional

Provide flexibility in choosing to use the host defined crypto
functions or the ones provided by the controller

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2018-06-26 11:51:18 +02:00 committed by Carles Cufí
commit 5e3c48f43c
3 changed files with 15 additions and 4 deletions

View file

@ -7,11 +7,15 @@ zephyr_library_sources(
ticker/ticker.c ticker/ticker.c
ll_sw/ll_addr.c ll_sw/ll_addr.c
ll_sw/ll_tx_pwr.c ll_sw/ll_tx_pwr.c
crypto/crypto.c
hci/hci_driver.c hci/hci_driver.c
hci/hci.c hci/hci.c
) )
zephyr_library_sources_ifdef(
CONFIG_BT_CTLR_CRYPTO
crypto/crypto.c
)
if(CONFIG_BT_LL_SW) if(CONFIG_BT_LL_SW)
zephyr_library_sources( zephyr_library_sources(
ll_sw/ctrl.c ll_sw/ctrl.c

View file

@ -33,6 +33,13 @@ endchoice
comment "BLE Controller configuration" comment "BLE Controller configuration"
config BT_CTLR_CRYPTO
bool "Enable crypto functions in Controller"
default y
help
Use random number generation and AES encryption support functions
provided by the controller.
config BT_CTLR_RX_PRIO_STACK_SIZE config BT_CTLR_RX_PRIO_STACK_SIZE
# Hidden option for Controller's Co-Operative high priority Rx thread # Hidden option for Controller's Co-Operative high priority Rx thread
# stack size. # stack size.

View file

@ -124,10 +124,10 @@ source "subsys/bluetooth/host/mesh/Kconfig"
config BT_HOST_CRYPTO config BT_HOST_CRYPTO
# Hidden option that compiles in random number generation and AES # Hidden option that compiles in random number generation and AES
# encryption support using TinyCrypt library if software-based # encryption support using TinyCrypt library if this is not provided
# controller is disabled. # by the controller implementation.
bool bool
default y if !BT_CTLR default y if !BT_CTLR_CRYPTO
select TINYCRYPT select TINYCRYPT
select TINYCRYPT_AES select TINYCRYPT_AES
select TINYCRYPT_SHA256 select TINYCRYPT_SHA256