summaryrefslogtreecommitdiff
path: root/osrng.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-07-12 04:23:32 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-07-12 04:23:32 +0000
commitd5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47 (patch)
tree4b03760892a97a9bc452ebe8b7793bbebd402ad4 /osrng.cpp
parentfa39f51809b4da54a5c2adb3e183b1a625cefb92 (diff)
downloadcryptopp-d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47.tar.gz
port to MSVC .NET 2005 beta 2
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@198 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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)