summaryrefslogtreecommitdiff
path: root/osrng.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-07-04 00:17:37 +0000
committerweidai <weidai11@users.noreply.github.com>2003-07-04 00:17:37 +0000
commitf278895908e663a6a5a2c1f63e5523c5004f5d20 (patch)
tree0536d87e504a82920156c239bc5ae6aa43e70ebc /osrng.h
parente43f74604744291d3a99b8bfe81d94af4ba6abbd (diff)
downloadcryptopp-git-f278895908e663a6a5a2c1f63e5523c5004f5d20.tar.gz
create DLL version, fix GetNextIV() bug in CTR and OFB modes
Diffstat (limited to 'osrng.h')
-rw-r--r--osrng.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/osrng.h b/osrng.h
index 902b2eee..655e4edf 100644
--- a/osrng.h
+++ b/osrng.h
@@ -7,11 +7,12 @@
#include "randpool.h"
#include "rng.h"
+#include "des.h"
NAMESPACE_BEGIN(CryptoPP)
//! Exception class for Operating-System Random Number Generator.
-class OS_RNG_Err : public Exception
+class CRYPTOPP_DLL OS_RNG_Err : public Exception
{
public:
OS_RNG_Err(const std::string &operation);
@@ -20,7 +21,7 @@ public:
#ifdef NONBLOCKING_RNG_AVAILABLE
#ifdef CRYPTOPP_WIN32_AVAILABLE
-class MicrosoftCryptoProvider
+class CRYPTOPP_DLL MicrosoftCryptoProvider
{
public:
MicrosoftCryptoProvider();
@@ -37,7 +38,7 @@ private:
#endif
//! encapsulate CryptoAPI's CryptGenRandom or /dev/urandom
-class NonblockingRng : public RandomNumberGenerator
+class CRYPTOPP_DLL NonblockingRng : public RandomNumberGenerator
{
public:
NonblockingRng();
@@ -60,7 +61,7 @@ protected:
#ifdef BLOCKING_RNG_AVAILABLE
//! encapsulate /dev/random
-class BlockingRng : public RandomNumberGenerator
+class CRYPTOPP_DLL BlockingRng : public RandomNumberGenerator
{
public:
BlockingRng();
@@ -74,11 +75,11 @@ protected:
#endif
-void OS_GenerateRandomBlock(bool blocking, byte *output, unsigned int size);
+CRYPTOPP_DLL void OS_GenerateRandomBlock(bool blocking, byte *output, unsigned int size);
//! Automaticly Seeded Randomness Pool
/*! This class seeds itself using an operating system provided RNG. */
-class AutoSeededRandomPool : public RandomPool
+class CRYPTOPP_DLL AutoSeededRandomPool : public RandomPool
{
public:
//! blocking will be ignored if the prefered RNG isn't available
@@ -89,7 +90,7 @@ public:
//! RNG from ANSI X9.17 Appendix C, seeded using an OS provided RNG
template <class BLOCK_CIPHER>
-class AutoSeededX917RNG : public RandomNumberGenerator
+class AutoSeededX917RNG : public RandomNumberGenerator, public NotCopyable
{
public:
//! blocking will be ignored if the prefered RNG isn't available
@@ -108,6 +109,8 @@ private:
unsigned int m_counter;
};
+CRYPTOPP_DLL_TEMPLATE_CLASS AutoSeededX917RNG<DES_EDE3>;
+
template <class BLOCK_CIPHER>
void AutoSeededX917RNG<BLOCK_CIPHER>::Reseed(const byte *key, unsigned int keylength, const byte *seed, unsigned long timeVector)
{