mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 23:35:49 +01:00
Add a config flag for the global RNG
The global RNG should be provided by the application depending on the RNG used there. (I.e. TRNG)
This commit is contained in:
parent
0736325d80
commit
d82e559a48
@ -3683,6 +3683,14 @@
|
||||
*/
|
||||
//#define MBEDTLS_PLATFORM_GMTIME_R_ALT
|
||||
|
||||
/**
|
||||
* Uncomment the macro to let Mbed TLS use a platform implementation of
|
||||
* global RNG.
|
||||
*
|
||||
* By default the global RNG function will be a no-op.
|
||||
*/
|
||||
//#define MBEDTLS_PLATFORM_GLOBAL_RNG
|
||||
|
||||
/* \} name SECTION: Customisation configuration options */
|
||||
|
||||
/**
|
||||
|
@ -137,12 +137,13 @@ int mbedtls_platform_memcmp( const void *buf1, const void *buf2, size_t num )
|
||||
return 1;
|
||||
}
|
||||
|
||||
//TODO: This is a stub implementation of the global RNG function.
|
||||
#if !defined(MBEDTLS_PLATFORM_GLOBAL_RNG)
|
||||
size_t mbedtls_random_in_range( size_t num )
|
||||
{
|
||||
(void) num;
|
||||
return 0;
|
||||
}
|
||||
#endif /* !MBEDTLS_PLATFORM_GLOBAL_RNG */
|
||||
|
||||
#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT)
|
||||
#include <time.h>
|
||||
|
Loading…
Reference in New Issue
Block a user