summaryrefslogtreecommitdiff
path: root/osrng.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-05-04 15:04:58 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-05-04 15:04:58 +0000
commitcdd57fd49c847250ce5d8e3cc39b7d882a529fc3 (patch)
treeaf7086b6bdb722b9a90c1abe0dd994166f32040b /osrng.cpp
parent061bcd669cf286d0043e1060bb36761df2df907e (diff)
downloadcryptopp-cdd57fd49c847250ce5d8e3cc39b7d882a529fc3.tar.gz
reduce risk of random number reuse after VM rollback
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@328 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'osrng.cpp')
-rw-r--r--osrng.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/osrng.cpp b/osrng.cpp
index 52d1f53..fa6dd36 100644
--- a/osrng.cpp
+++ b/osrng.cpp
@@ -74,13 +74,6 @@ NonblockingRng::~NonblockingRng()
#endif
}
-byte NonblockingRng::GenerateByte()
-{
- byte b;
- GenerateBlock(&b, 1);
- return b;
-}
-
void NonblockingRng::GenerateBlock(byte *output, size_t size)
{
#ifdef CRYPTOPP_WIN32_AVAILABLE
@@ -121,13 +114,6 @@ BlockingRng::~BlockingRng()
close(m_fd);
}
-byte BlockingRng::GenerateByte()
-{
- byte b;
- GenerateBlock(&b, 1);
- return b;
-}
-
void BlockingRng::GenerateBlock(byte *output, size_t size)
{
while (size)
@@ -175,7 +161,7 @@ void AutoSeededRandomPool::Reseed(bool blocking, unsigned int seedSize)
{
SecByteBlock seed(seedSize);
OS_GenerateRandomBlock(blocking, seed, seedSize);
- Put(seed, seedSize);
+ IncorporateEntropy(seed, seedSize);
}
NAMESPACE_END