Crypto++
adler32.h
1 #ifndef CRYPTOPP_ADLER32_H
2 #define CRYPTOPP_ADLER32_H
3 
4 #include "cryptlib.h"
5 
6 NAMESPACE_BEGIN(CryptoPP)
7 
8 //! ADLER-32 checksum calculations
9 class Adler32 : public HashTransformation
10 {
11 public:
12  CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
13  Adler32() {Reset();}
14  void Update(const byte *input, size_t length);
15  void TruncatedFinal(byte *hash, size_t size);
16  unsigned int DigestSize() const {return DIGESTSIZE;}
17  static const char * StaticAlgorithmName() {return "Adler32";}
18  std::string AlgorithmName() const {return StaticAlgorithmName();}
19 
20 private:
21  void Reset() {m_s1 = 1; m_s2 = 0;}
22 
23  word16 m_s1, m_s2;
24 };
25 
26 NAMESPACE_END
27 
28 #endif
std::string AlgorithmName() const
returns name of this algorithm, not universally implemented yet
Definition: adler32.h:18
unsigned int DigestSize() const
size of the hash/digest/MAC returned by Final()
Definition: adler32.h:16
ADLER-32 checksum calculations.
Definition: adler32.h:9
interface for hash functions and data processing part of MACs
Definition: cryptlib.h:530