00001
00002
00003
00004
00005
00006
00007 #ifndef CRYPTOPP_ADLER32_H
00008 #define CRYPTOPP_ADLER32_H
00009
00010 #include "cryptlib.h"
00011
00012 NAMESPACE_BEGIN(CryptoPP)
00013
00014
00015 class Adler32 : public HashTransformation
00016 {
00017 public:
00018 CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
00019 Adler32() {Reset();}
00020 void Update(const byte *input, size_t length);
00021 void TruncatedFinal(byte *hash, size_t size);
00022 unsigned int DigestSize() const {return DIGESTSIZE;}
00023 static const char * StaticAlgorithmName() {return "Adler32";}
00024 std::string AlgorithmName() const {return StaticAlgorithmName();}
00025
00026 private:
00027 void Reset() {m_s1 = 1; m_s2 = 0;}
00028
00029 word16 m_s1, m_s2;
00030 };
00031
00032 NAMESPACE_END
00033
00034 #endif