mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
entropy_func() threading support
This commit is contained in:
@ -41,6 +41,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_THREADING_C)
|
||||
#include "threading.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_HAVEGE_C)
|
||||
#include "havege.h"
|
||||
#endif
|
||||
@ -106,6 +110,9 @@ typedef struct
|
||||
#if defined(POLARSSL_HAVEGE_C)
|
||||
havege_state havege_data;
|
||||
#endif
|
||||
#if defined(POLARSSL_THREADING_C)
|
||||
threading_mutex_t mutex; /*!< mutex */
|
||||
#endif
|
||||
}
|
||||
entropy_context;
|
||||
|
||||
@ -149,6 +156,7 @@ int entropy_gather( entropy_context *ctx );
|
||||
|
||||
/**
|
||||
* \brief Retrieve entropy from the accumulator (Max ENTROPY_BLOCK_SIZE)
|
||||
* (Thread-safe if POLARSSL_THREADING_C is enabled)
|
||||
*
|
||||
* \param data Entropy context
|
||||
* \param output Buffer to fill
|
||||
|
Reference in New Issue
Block a user