mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
- Added HAVEGE as a default entropy source
This commit is contained in:
@ -30,6 +30,10 @@
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/entropy_poll.h"
|
||||
|
||||
#if defined(POLARSSL_HAVEGE_C)
|
||||
#include "polarssl/havege.h"
|
||||
#endif
|
||||
|
||||
#define ENTROPY_MAX_LOOP 256 /**< Maximum amount to loop before error */
|
||||
|
||||
void entropy_init( entropy_context *ctx )
|
||||
@ -45,6 +49,11 @@ void entropy_init( entropy_context *ctx )
|
||||
#if defined(POLARSSL_TIMING_C)
|
||||
entropy_add_source( ctx, hardclock_poll, NULL, ENTROPY_MIN_HARDCLOCK );
|
||||
#endif
|
||||
#if defined(POLARSSL_HAVEGE_C)
|
||||
havege_init( &ctx->havege_data );
|
||||
entropy_add_source( ctx, havege_poll, &ctx->havege_data,
|
||||
ENTROPY_MIN_HAVEGE );
|
||||
#endif
|
||||
}
|
||||
|
||||
int entropy_add_source( entropy_context *ctx,
|
||||
|
Reference in New Issue
Block a user