From eccec2a5ac276f3dd62fc791321b32c933df5ef2 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 9 Feb 2016 11:17:02 +0100 Subject: [PATCH] Bluetooth: Kconfig: Add option for enabling TinyCrypt Add a single option for enabling use of TinyCrypt library for crypto. This option selects all required TinyCrypt options depending on BT features enabled. Thanks to this applications only need to select single option instead of set of required TinyCrypt features. Change-Id: I2862e9ad3e204635f2ed3199433982bcfb7112f6 Signed-off-by: Szymon Janc --- net/bluetooth/Kconfig | 12 ++++++++++++ samples/bluetooth/ipsp/prj.conf | 3 +-- samples/bluetooth/peripheral/prj.conf | 3 +-- samples/bluetooth/peripheral_hr/prj.conf | 3 +-- samples/bluetooth/shell/prj_x86.conf | 6 +----- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig index 1d0e6496951..d118a355d76 100644 --- a/net/bluetooth/Kconfig +++ b/net/bluetooth/Kconfig @@ -35,6 +35,18 @@ config BLUETOOTH_LE (CONFIG_BLUETOOTH) is enabled. if BLUETOOTH_LE +config BLUETOOTH_TINYCRYPT + bool "Use TinyCrypt library" + default n + select TINYCRYPT + select TINYCRYPT_AES if BLUETOOTH_SMP + select TINYCRYPT_SHA256 + select TINYCRYPT_SHA256_HMAC + select TINYCRYPT_SHA256_HMAC_PRNG + help + "If this option is set TinyCrypt library is used for Bluetooth + cryptographic operations. If not set controller crypto is used" + config BLUETOOTH_HCI_CMD_COUNT int "Number of HCI command buffers" default 2 diff --git a/samples/bluetooth/ipsp/prj.conf b/samples/bluetooth/ipsp/prj.conf index b13ed0bdcf4..92067f15f68 100644 --- a/samples/bluetooth/ipsp/prj.conf +++ b/samples/bluetooth/ipsp/prj.conf @@ -4,8 +4,7 @@ CONFIG_BLUETOOTH_LE=y CONFIG_BLUETOOTH_DEBUG=y CONFIG_BLUETOOTH_SMP=y CONFIG_BLUETOOTH_SIGNING=y -CONFIG_TINYCRYPT=y -CONFIG_TINYCRYPT_AES=y +CONFIG_BLUETOOTH_TINYCRYPT=y CONFIG_BLUETOOTH_PERIPHERAL=y CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL=y CONFIG_NETWORKING=y diff --git a/samples/bluetooth/peripheral/prj.conf b/samples/bluetooth/peripheral/prj.conf index 93c1db26b53..0cc037fbd82 100644 --- a/samples/bluetooth/peripheral/prj.conf +++ b/samples/bluetooth/peripheral/prj.conf @@ -4,7 +4,6 @@ CONFIG_BLUETOOTH_LE=y CONFIG_BLUETOOTH_DEBUG=y CONFIG_BLUETOOTH_SMP=y CONFIG_BLUETOOTH_SIGNING=y -CONFIG_TINYCRYPT=y -CONFIG_TINYCRYPT_AES=y +CONFIG_BLUETOOTH_TINYCRYPT=y CONFIG_BLUETOOTH_PERIPHERAL=y CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y diff --git a/samples/bluetooth/peripheral_hr/prj.conf b/samples/bluetooth/peripheral_hr/prj.conf index f86a01fd75f..8fef00b1d9f 100644 --- a/samples/bluetooth/peripheral_hr/prj.conf +++ b/samples/bluetooth/peripheral_hr/prj.conf @@ -3,7 +3,6 @@ CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_LE=y CONFIG_BLUETOOTH_DEBUG=y CONFIG_BLUETOOTH_SMP=y -CONFIG_TINYCRYPT=y -CONFIG_TINYCRYPT_AES=y +CONFIG_BLUETOOTH_TINYCRYPT=y CONFIG_BLUETOOTH_PERIPHERAL=y CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y diff --git a/samples/bluetooth/shell/prj_x86.conf b/samples/bluetooth/shell/prj_x86.conf index 71f8b9a890d..baa877aab9d 100644 --- a/samples/bluetooth/shell/prj_x86.conf +++ b/samples/bluetooth/shell/prj_x86.conf @@ -11,9 +11,5 @@ CONFIG_BLUETOOTH_SMP=y CONFIG_BLUETOOTH_SIGNING=y CONFIG_BLUETOOTH_GATT_CLIENT=y CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL=y -CONFIG_TINYCRYPT=y -CONFIG_TINYCRYPT_AES=y -CONFIG_TINYCRYPT_SHA256=y -CONFIG_TINYCRYPT_SHA256_HMAC=y -CONFIG_TINYCRYPT_SHA256_HMAC_PRNG=y +CONFIG_BLUETOOTH_TINYCRYPT=y CONFIG_CONSOLE_HANDLER_SHELL=y