Coverage Report

Created: 2024-11-21 07:03

/src/cryptopp/adler32.h
Line
Count
Source (jump to first uncovered line)
1
// adler32.h - originally written and placed in the public domain by Wei Dai
2
3
/// \file adler32.h
4
/// \brief Class file for ADLER-32 checksum calculations
5
6
#ifndef CRYPTOPP_ADLER32_H
7
#define CRYPTOPP_ADLER32_H
8
9
#include "cryptlib.h"
10
11
NAMESPACE_BEGIN(CryptoPP)
12
13
/// ADLER-32 checksum calculations
14
class Adler32 : public HashTransformation
15
{
16
public:
17
  CRYPTOPP_CONSTANT(DIGESTSIZE = 4);
18
0
  Adler32() {Reset();}
19
  void Update(const byte *input, size_t length);
20
  void TruncatedFinal(byte *hash, size_t size);
21
0
  unsigned int DigestSize() const {return DIGESTSIZE;}
22
0
    CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Adler32";}
23
0
    std::string AlgorithmName() const {return StaticAlgorithmName();}
24
25
private:
26
0
  void Reset() {m_s1 = 1; m_s2 = 0;}
27
28
  word16 m_s1, m_s2;
29
};
30
31
NAMESPACE_END
32
33
#endif