VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Random.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-08 23:41:29 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-11 18:31:30 +0100
commit32e72d111747bcfee8ba0ecfb30045b6cd42685f (patch)
treeb21c674e1dbecd055d8904ce554c549d918140e3 /src/Common/Random.h
parentfd0e434087ee51d8bc7be6ea1287685d91dc4b1e (diff)
downloadVeraCrypt-32e72d111747bcfee8ba0ecfb30045b6cd42685f.tar.gz
VeraCrypt-32e72d111747bcfee8ba0ecfb30045b6cd42685f.zip
Implement function RandgetBytesFull that enables generating random bytes of any length.
Diffstat (limited to 'src/Common/Random.h')
-rw-r--r--src/Common/Random.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Common/Random.h b/src/Common/Random.h
index ffb443ad..1a3a51d8 100644
--- a/src/Common/Random.h
+++ b/src/Common/Random.h
@@ -44,8 +44,16 @@ void RandaddBuf ( void *buf , int len );
BOOL FastPoll ( void );
BOOL SlowPoll ( void );
BOOL RandpeekBytes ( unsigned char *buf , int len );
+
+/* Get len random bytes from the pool (max. RNG_POOL_SIZE bytes per a single call) */
BOOL RandgetBytes ( unsigned char *buf , int len, BOOL forceSlowPoll );
+/* Get len random bytes from the pool.
+ * If allowAnyLength is FALSE, then len must be less or equal to RNG_POOL_SIZE
+ * If allowAnyLength is TRUE, then len can have any positive value
+ */
+BOOL RandgetBytesFull ( unsigned char *buf , int len, BOOL forceSlowPoll , BOOL allowAnyLength);
+
#ifdef _WIN32
extern BOOL volatile bFastPollEnabled;