Skip to content

Commit b408445

Browse files
alxelaxkartben
authored andcommitted
bluetooth: mesh: remove tinycrypt support
Tinycrypt support deprecated in Zephyr 4.0 release. Time to remove it. Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
1 parent 3f5f981 commit b408445

File tree

5 files changed

+1
-225
lines changed

5 files changed

+1
-225
lines changed

include/zephyr/bluetooth/mesh/keys.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,18 @@
1212
#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_KEYS_H_
1313

1414
#include <stdint.h>
15-
#if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA
1615
#include <psa/crypto.h>
17-
#endif
1816

1917
#ifdef __cplusplus
2018
extern "C" {
2119
#endif
2220

23-
#if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA
24-
2521
/** The structure that keeps representation of key. */
2622
struct bt_mesh_key {
2723
/** PSA key representation is the PSA key identifier. */
2824
psa_key_id_t key;
2925
};
3026

31-
#elif defined CONFIG_BT_MESH_USES_TINYCRYPT
32-
33-
/** The structure that keeps representation of key. */
34-
struct bt_mesh_key {
35-
/** tinycrypt key representation is the pure key value. */
36-
uint8_t key[16];
37-
};
38-
39-
#else
40-
#error "Crypto library has not been chosen"
41-
#endif
42-
4327
#ifdef __cplusplus
4428
}
4529
#endif

subsys/bluetooth/mesh/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ zephyr_library_sources_ifdef(CONFIG_BT_MESH
1313
app_keys.c
1414
heartbeat.c
1515
crypto.c
16+
crypto_psa.c
1617
access.c
1718
msg.c
1819
cfg_srv.c
@@ -123,12 +124,6 @@ zephyr_library_sources_ifdef(CONFIG_BT_MESH_STATISTIC statistic.c)
123124

124125
zephyr_library_sources_ifdef(CONFIG_BT_MESH_ACCESS_DELAYABLE_MSG delayable_msg.c)
125126

126-
if (CONFIG_BT_MESH_USES_TINYCRYPT)
127-
zephyr_library_sources(crypto_tc.c)
128-
else()
129-
zephyr_library_sources(crypto_psa.c)
130-
endif()
131-
132127
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
133128

134129
zephyr_library_include_directories_ifdef(CONFIG_BUILD_WITH_TFM

subsys/bluetooth/mesh/Kconfig

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,19 +1494,6 @@ choice BT_MESH_CRYPTO_LIB
14941494
help
14951495
Crypto library selection for mesh security.
14961496

1497-
config BT_MESH_USES_TINYCRYPT
1498-
bool "TinyCrypt [DEPRECATED]"
1499-
select DEPRECATED
1500-
select TINYCRYPT
1501-
select TINYCRYPT_AES
1502-
select TINYCRYPT_AES_CMAC
1503-
select TINYCRYPT_ECC_DH
1504-
select TINYCRYPT_SHA256
1505-
select TINYCRYPT_SHA256_HMAC
1506-
select BT_HOST_CCM
1507-
help
1508-
Use TinyCrypt library to perform crypto operations.
1509-
15101497
config BT_MESH_USES_MBEDTLS_PSA
15111498
bool "mbed TLS PSA"
15121499
select MBEDTLS

subsys/bluetooth/mesh/crypto_tc.c

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

subsys/bluetooth/mesh/keys.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,8 @@ enum bt_mesh_key_type {
1313
BT_MESH_KEY_TYPE_DEV
1414
};
1515

16-
#if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA
17-
1816
int bt_mesh_key_import(enum bt_mesh_key_type type, const uint8_t in[16], struct bt_mesh_key *out);
1917
int bt_mesh_key_export(uint8_t out[16], const struct bt_mesh_key *in);
2018
void bt_mesh_key_assign(struct bt_mesh_key *dst, const struct bt_mesh_key *src);
2119
int bt_mesh_key_destroy(const struct bt_mesh_key *key);
2220
int bt_mesh_key_compare(const uint8_t raw_key[16], const struct bt_mesh_key *mesh_key);
23-
24-
#elif defined CONFIG_BT_MESH_USES_TINYCRYPT
25-
26-
static inline int bt_mesh_key_import(enum bt_mesh_key_type type, const uint8_t in[16],
27-
struct bt_mesh_key *out)
28-
{
29-
memcpy(out, in, 16);
30-
return 0;
31-
}
32-
33-
static inline int bt_mesh_key_export(uint8_t out[16], const struct bt_mesh_key *in)
34-
{
35-
memcpy(out, in, 16);
36-
return 0;
37-
}
38-
39-
static inline void bt_mesh_key_assign(struct bt_mesh_key *dst, const struct bt_mesh_key *src)
40-
{
41-
memcpy(dst, src, sizeof(struct bt_mesh_key));
42-
}
43-
44-
static inline int bt_mesh_key_destroy(const struct bt_mesh_key *key)
45-
{
46-
return 0;
47-
}
48-
49-
static inline int bt_mesh_key_compare(const uint8_t raw_key[16], const struct bt_mesh_key *mesh_key)
50-
{
51-
return memcmp(mesh_key, raw_key, 16);
52-
}
53-
54-
#endif

0 commit comments

Comments
 (0)