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.

28 lines
628 B

  1. #ifndef CRYPTOPP_ADLER32_H
  2. #define CRYPTOPP_ADLER32_H
  3. #include "cryptlib.h"
  4. NAMESPACE_BEGIN(CryptoPP)
  5. //! ADLER-32 checksum calculations
  6. class Adler32 : public HashTransformation
  7. {
  8. public:
  9. CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
  10. Adler32() {Reset();}
  11. void Update(const byte *input, size_t length);
  12. void TruncatedFinal(byte *hash, size_t size);
  13. unsigned int DigestSize() const {return DIGESTSIZE;}
  14. static const char * StaticAlgorithmName() {return "Adler32";}
  15. std::string AlgorithmName() const {return StaticAlgorithmName();}
  16. private:
  17. void Reset() {m_s1 = 1; m_s2 = 0;}
  18. word16 m_s1, m_s2;
  19. };
  20. NAMESPACE_END
  21. #endif