Fabcoin Core  0.16.2
P2P Digital Currency
adler32.h
Go to the documentation of this file.
1 // adler32.h - written and placed in the public domain by Wei Dai
2 
6 
7 #ifndef CRYPTOPP_ADLER32_H
8 #define CRYPTOPP_ADLER32_H
9 
10 #include "cryptlib.h"
11 
13 
14 class Adler32 : public HashTransformation
16 {
17 public:
18  CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
19  Adler32() {Reset();}
20  void Update(const byte *input, size_t length);
21  void TruncatedFinal(byte *hash, size_t size);
22  unsigned int DigestSize() const {return DIGESTSIZE;}
23  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Adler32";}
24  std::string AlgorithmName() const {return StaticAlgorithmName();}
25 
26 private:
27  void Reset() {m_s1 = 1; m_s2 = 0;}
28 
29  word16 m_s1, m_s2;
30 };
31 
33 
34 #endif
uint8_t byte
Definition: Common.h:57
#define CRYPTOPP_STATIC_CONSTEXPR
Definition: config.h:892
std::string AlgorithmName() const
Provides the name of this algorithm.
Definition: adler32.h:24
unsigned short word16
Definition: config.h:230
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Abstract base classes that provide a uniform interface to this library.
unsigned int DigestSize() const
Provides the digest size of the hash.
Definition: adler32.h:22
ADLER-32 checksum calculations.
Definition: adler32.h:15
void Reset()
Definition: adler32.h:27
#define CRYPTOPP_CONSTANT(x)
Definition: config.h:540
uint8_t const size_t const size
Definition: sha3.h:20
Interface for hash functions and data processing part of MACs.
Definition: cryptlib.h:930
#define NAMESPACE_END
Definition: config.h:201
word16 m_s2
Definition: adler32.h:29
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Definition: adler32.h:23