9#ifdef CONFIG_BT_ENABLED
14static const char*
const TAG =
"CW_Utils";
16bool CW_Utils::fill_secure_random(uint8_t *dest,
size_t len) {
19 if ((dest !=
nullptr) && (len != 0U)) {
20 wifi_mode_t mode = WIFI_MODE_NULL;
21 bool wifi_on = ((esp_wifi_get_mode(&mode) == ESP_OK) && (mode != WIFI_MODE_NULL));
23#ifdef CONFIG_BT_ENABLED
24 bool bt_on = (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED);
33 if ((!wifi_on) && (!bt_on)) {
34 ESP_LOGW(
TAG,
"RNG: no radio active — reduced entropy (TRNG only)");
37 esp_fill_random(dest, len);
static const char *const TAG