summaryrefslogtreecommitdiff
path: root/osrng.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'osrng.cpp')
-rw-r--r--osrng.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/osrng.cpp b/osrng.cpp
index b1a03ca..c3c4e80 100644
--- a/osrng.cpp
+++ b/osrng.cpp
@@ -81,13 +81,13 @@ byte NonblockingRng::GenerateByte()
return b;
}
-void NonblockingRng::GenerateBlock(byte *output, unsigned int size)
+void NonblockingRng::GenerateBlock(byte *output, size_t size)
{
#ifdef CRYPTOPP_WIN32_AVAILABLE
# ifdef WORKAROUND_MS_BUG_Q258000
static MicrosoftCryptoProvider m_Provider;
# endif
- if (!CryptGenRandom(m_Provider.GetProviderHandle(), size, output))
+ if (!CryptGenRandom(m_Provider.GetProviderHandle(), (DWORD)size, output))
throw OS_RNG_Err("CryptGenRandom");
#else
if (read(m_fd, output, size) != size)
@@ -120,7 +120,7 @@ byte BlockingRng::GenerateByte()
return b;
}
-void BlockingRng::GenerateBlock(byte *output, unsigned int size)
+void BlockingRng::GenerateBlock(byte *output, size_t size)
{
while (size)
{
@@ -140,7 +140,7 @@ void BlockingRng::GenerateBlock(byte *output, unsigned int size)
// *************************************************************
-void OS_GenerateRandomBlock(bool blocking, byte *output, unsigned int size)
+void OS_GenerateRandomBlock(bool blocking, byte *output, size_t size)
{
#ifdef NONBLOCKING_RNG_AVAILABLE
if (blocking)