Bluetooth: Mesh: no more tinycrypt in ble mesh tfm image

PR allows to get rid of tinycrypt objects from
the final binary of the ble mesh apps based on
PSA TFM crypto.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
This commit is contained in:
Aleksandr Khromykh 2023-11-01 15:44:23 +01:00 committed by Fabio Baltieri
commit c5ee143d77
9 changed files with 59 additions and 21 deletions

View file

@ -7,6 +7,7 @@
#include <errno.h>
#include <zephyr/bluetooth/mesh.h>
#include <zephyr/sys/check.h>
#define LOG_LEVEL CONFIG_BT_MESH_CRYPTO_LOG_LEVEL
#include <zephyr/logging/log.h>
@ -510,3 +511,12 @@ int bt_mesh_key_compare(const uint8_t raw_key[16], const struct bt_mesh_key *key
return memcmp(out, raw_key, 16);
}
__weak int bt_rand(void *buf, size_t len)
{
CHECKIF(buf == NULL || len == 0) {
return -EINVAL;
}
return psa_generate_random(buf, len) == PSA_SUCCESS ? 0 : -EIO;
}