Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:53

0001 // adler32.h - originally written and placed in the public domain by Wei Dai

0002 
0003 /// \file adler32.h

0004 /// \brief Class file for ADLER-32 checksum calculations

0005 
0006 #ifndef CRYPTOPP_ADLER32_H
0007 #define CRYPTOPP_ADLER32_H
0008 
0009 #include "cryptlib.h"
0010 
0011 NAMESPACE_BEGIN(CryptoPP)
0012 
0013 /// ADLER-32 checksum calculations

0014 class Adler32 : public HashTransformation
0015 {
0016 public:
0017     CRYPTOPP_CONSTANT(DIGESTSIZE = 4);
0018     Adler32() {Reset();}
0019     void Update(const byte *input, size_t length);
0020     void TruncatedFinal(byte *hash, size_t size);
0021     unsigned int DigestSize() const {return DIGESTSIZE;}
0022     CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Adler32";}
0023     std::string AlgorithmName() const {return StaticAlgorithmName();}
0024 
0025 private:
0026     void Reset() {m_s1 = 1; m_s2 = 0;}
0027 
0028     word16 m_s1, m_s2;
0029 };
0030 
0031 NAMESPACE_END
0032 
0033 #endif