entropy_func() threading support
diff --git a/include/polarssl/entropy.h b/include/polarssl/entropy.h
index e334c22..235b773 100644
--- a/include/polarssl/entropy.h
+++ b/include/polarssl/entropy.h
@@ -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 @@
#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 @@
/**
* \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