2002-10-04 17:31:41 +00:00
|
|
|
#ifndef CRYPTOPP_ADLER32_H
|
|
|
|
#define CRYPTOPP_ADLER32_H
|
|
|
|
|
|
|
|
#include "cryptlib.h"
|
|
|
|
|
|
|
|
NAMESPACE_BEGIN(CryptoPP)
|
|
|
|
|
|
|
|
//! ADLER-32 checksum calculations
|
|
|
|
class Adler32 : public HashTransformation
|
|
|
|
{
|
|
|
|
public:
|
2006-12-14 11:41:39 +00:00
|
|
|
CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
|
2002-10-04 17:31:41 +00:00
|
|
|
Adler32() {Reset();}
|
2005-07-12 04:23:32 +00:00
|
|
|
void Update(const byte *input, size_t length);
|
|
|
|
void TruncatedFinal(byte *hash, size_t size);
|
2002-10-04 17:31:41 +00:00
|
|
|
unsigned int DigestSize() const {return DIGESTSIZE;}
|
2009-03-04 09:27:52 +00:00
|
|
|
static const char * StaticAlgorithmName() {return "Adler32";}
|
|
|
|
std::string AlgorithmName() const {return StaticAlgorithmName();}
|
2002-10-04 17:31:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Reset() {m_s1 = 1; m_s2 = 0;}
|
|
|
|
|
|
|
|
word16 m_s1, m_s2;
|
|
|
|
};
|
|
|
|
|
|
|
|
NAMESPACE_END
|
|
|
|
|
|
|
|
#endif
|