mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-22 01:27:11 +08:00

Commit ID: 97959e77. Using submodule instead of source code. It is brought from esp-idf, and some origin dependent code or configuration of hardware have not been removed. But it maybe not affect using at the ESP8266 platform.
27 lines
529 B
C
27 lines
529 B
C
#if !defined(MBEDTLS_CONFIG_FILE)
|
|
#include "mbedtls/config.h"
|
|
#else
|
|
#include MBEDTLS_CONFIG_FILE
|
|
#endif
|
|
|
|
#include <sys/types.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <esp_system.h>
|
|
|
|
#include "mbedtls/entropy_poll.h"
|
|
|
|
#ifndef MBEDTLS_ENTROPY_HARDWARE_ALT
|
|
#error "MBEDTLS_ENTROPY_HARDWARE_ALT should always be set in ESP-IDF"
|
|
#endif
|
|
|
|
int mbedtls_hardware_poll( void *data,
|
|
unsigned char *output, size_t len, size_t *olen )
|
|
{
|
|
esp_fill_random(output, len);
|
|
*olen = len;
|
|
return 0;
|
|
}
|
|
|
|
|