File tree Expand file tree Collapse file tree 5 files changed +1
-225
lines changed
include/zephyr/bluetooth/mesh Expand file tree Collapse file tree 5 files changed +1
-225
lines changed Original file line number Diff line number Diff line change 12
12
#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_KEYS_H_
13
13
14
14
#include <stdint.h>
15
- #if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA
16
15
#include <psa/crypto.h>
17
- #endif
18
16
19
17
#ifdef __cplusplus
20
18
extern "C" {
21
19
#endif
22
20
23
- #if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA
24
-
25
21
/** The structure that keeps representation of key. */
26
22
struct bt_mesh_key {
27
23
/** PSA key representation is the PSA key identifier. */
28
24
psa_key_id_t key ;
29
25
};
30
26
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
-
43
27
#ifdef __cplusplus
44
28
}
45
29
#endif
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ zephyr_library_sources_ifdef(CONFIG_BT_MESH
13
13
app_keys.c
14
14
heartbeat.c
15
15
crypto.c
16
+ crypto_psa.c
16
17
access.c
17
18
msg.c
18
19
cfg_srv.c
@@ -123,12 +124,6 @@ zephyr_library_sources_ifdef(CONFIG_BT_MESH_STATISTIC statistic.c)
123
124
124
125
zephyr_library_sources_ifdef (CONFIG_BT_MESH_ACCESS_DELAYABLE_MSG delayable_msg.c )
125
126
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
-
132
127
zephyr_library_link_libraries_ifdef (CONFIG_MBEDTLS mbedTLS )
133
128
134
129
zephyr_library_include_directories_ifdef (CONFIG_BUILD_WITH_TFM
Original file line number Diff line number Diff line change @@ -1494,19 +1494,6 @@ choice BT_MESH_CRYPTO_LIB
1494
1494
help
1495
1495
Crypto library selection for mesh security.
1496
1496
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
-
1510
1497
config BT_MESH_USES_MBEDTLS_PSA
1511
1498
bool "mbed TLS PSA"
1512
1499
select MBEDTLS
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -13,42 +13,8 @@ enum bt_mesh_key_type {
13
13
BT_MESH_KEY_TYPE_DEV
14
14
};
15
15
16
- #if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA
17
-
18
16
int bt_mesh_key_import (enum bt_mesh_key_type type , const uint8_t in [16 ], struct bt_mesh_key * out );
19
17
int bt_mesh_key_export (uint8_t out [16 ], const struct bt_mesh_key * in );
20
18
void bt_mesh_key_assign (struct bt_mesh_key * dst , const struct bt_mesh_key * src );
21
19
int bt_mesh_key_destroy (const struct bt_mesh_key * key );
22
20
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
You can’t perform that action at this time.
0 commit comments