mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 12:07:52 +00:00
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:

committed by
BOT

parent
ab2829d65f
commit
aa581523c9
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user