FillRand()
authorCryptoManiac <balthazar.ad@gmail.com>
Sat, 16 Apr 2016 02:26:20 +0000 (05:26 +0300)
committerCryptoManiac <balthazar.ad@gmail.com>
Sat, 16 Apr 2016 02:26:20 +0000 (05:26 +0300)
src/util.cpp
src/util.h

index 982c1e5..8eba871 100644 (file)
@@ -185,10 +185,15 @@ int GetRandInt(int nMax)
 uint256 GetRandHash()
 {
     uint256 hash;
-    RAND_bytes((unsigned char*)&hash, sizeof(hash));
+    RAND_bytes((uint8_t*)&hash, sizeof(hash));
     return hash;
 }
 
+void FillRand(uint8_t *buffer, size_t nCount)
+{
+    RAND_bytes(buffer, nCount);
+}
+
 static FILE* fileout = NULL;
 
 inline int OutputDebugStringF(const char* pszFormat, ...)
index 48b092f..e32a468 100644 (file)
@@ -233,6 +233,7 @@ void ShrinkDebugFile();
 int GetRandInt(int nMax);
 uint64_t GetRand(uint64_t nMax);
 uint256 GetRandHash();
+void FillRand(uint8_t *buffer, size_t nCount);
 int64_t GetTime();
 int64_t GetTimeMillis();
 int64_t GetTimeMicros();