feat(mbedtls): Add mbedtls_esp_random()

Suitable for passing as f_rng to various Mbed-TLS APIs that require it
This commit is contained in:
Deomid rojer Ryabkov
2025-03-30 00:49:08 +02:00
committed by BOT
parent ab2829d65f
commit aa581523c9
2 changed files with 36 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "esp_random.h"
#include "mbedtls/esp_random.h"
#include <entropy_poll.h>
@@ -23,3 +24,9 @@ int mbedtls_hardware_poll( void *data,
*olen = len;
return 0;
}
int mbedtls_esp_random(void *ctx, unsigned char *buf, size_t len)
{
esp_fill_random(buf, len);
return 0;
}