Crypto++
8.6
Free C++ class library of cryptographic schemes
adler32.h
Go to the documentation of this file.
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
Adler32
() {Reset();}
19
void
Update(
const
byte
*input,
size_t
length);
20
void
TruncatedFinal(
byte
*hash,
size_t
size);
21
unsigned
int
DigestSize
()
const
{
return
DIGESTSIZE;}
22
CRYPTOPP_STATIC_CONSTEXPR
const
char
* StaticAlgorithmName() {
return
"Adler32"
;}
23
std::string
AlgorithmName
()
const
{
return
StaticAlgorithmName();}
24
25
private
:
26
void
Reset() {m_s1 = 1; m_s2 = 0;}
27
28
word16
m_s1, m_s2;
29
};
30
31
NAMESPACE_END
32
33
#endif
HashTransformation
Interface for hash functions and data processing part of MACs.
Definition:
cryptlib.h:1112
Adler32::AlgorithmName
std::string AlgorithmName() const
Provides the name of this algorithm.
Definition:
adler32.h:23
Adler32::DigestSize
unsigned int DigestSize() const
Provides the digest size of the hash.
Definition:
adler32.h:21
CryptoPP
Crypto++ library namespace.
Adler32
ADLER-32 checksum calculations.
Definition:
adler32.h:14
word16
unsigned short word16
16-bit unsigned datatype
Definition:
config_int.h:59
cryptlib.h
Abstract base classes that provide a uniform interface to this library.
Generated on Sun May 29 2022 18:23:22 for Crypto++ by
1.8.17