From d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47 Mon Sep 17 00:00:00 2001 From: weidai Date: Tue, 12 Jul 2005 04:23:32 +0000 Subject: 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 --- osrng.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'osrng.cpp') 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) -- cgit v1.2.1