From f278895908e663a6a5a2c1f63e5523c5004f5d20 Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 4 Jul 2003 00:17:37 +0000 Subject: create DLL version, fix GetNextIV() bug in CTR and OFB modes --- osrng.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'osrng.h') 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 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; + template void AutoSeededX917RNG::Reseed(const byte *key, unsigned int keylength, const byte *seed, unsigned long timeVector) { -- cgit v1.2.1