Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
998 B

  1. #ifndef CRYPTOPP_RANDPOOL_H
  2. #define CRYPTOPP_RANDPOOL_H
  3. #include "cryptlib.h"
  4. #include "filters.h"
  5. NAMESPACE_BEGIN(CryptoPP)
  6. //! Randomness Pool
  7. /*! This class can be used to generate cryptographic quality
  8. pseudorandom bytes after seeding the pool with IncorporateEntropy() */
  9. class CRYPTOPP_DLL RandomPool : public RandomNumberGenerator, public NotCopyable
  10. {
  11. public:
  12. RandomPool();
  13. bool CanIncorporateEntropy() const {return true;}
  14. void IncorporateEntropy(const byte *input, size_t length);
  15. void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size);
  16. // for backwards compatibility. use RandomNumberSource, RandomNumberStore, and RandomNumberSink for other BufferTransformation functionality
  17. void Put(const byte *input, size_t length) {IncorporateEntropy(input, length);}
  18. private:
  19. FixedSizeSecBlock<byte, 32> m_key;
  20. FixedSizeSecBlock<byte, 16> m_seed;
  21. member_ptr<BlockCipher> m_pCipher;
  22. bool m_keySet;
  23. };
  24. NAMESPACE_END
  25. #endif