diff options
author | weidai <weidai11@users.noreply.github.com> | 2002-10-04 17:31:41 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2002-10-04 17:31:41 +0000 |
commit | a3b6ece7ab341b5b14135baeccea7d5e4c086771 (patch) | |
tree | 8b045309c238226c32a563b1df6b9c30a2f0e0b3 /adler32.h | |
download | cryptopp-git-a3b6ece7ab341b5b14135baeccea7d5e4c086771.tar.gz |
Initial revision
Diffstat (limited to 'adler32.h')
-rw-r--r-- | adler32.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/adler32.h b/adler32.h new file mode 100644 index 00000000..5c9d8cfb --- /dev/null +++ b/adler32.h @@ -0,0 +1,26 @@ +#ifndef CRYPTOPP_ADLER32_H +#define CRYPTOPP_ADLER32_H + +#include "cryptlib.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! ADLER-32 checksum calculations +class Adler32 : public HashTransformation +{ +public: + enum {DIGESTSIZE = 4}; + Adler32() {Reset();} + void Update(const byte *input, unsigned int length); + void TruncatedFinal(byte *hash, unsigned int size); + unsigned int DigestSize() const {return DIGESTSIZE;} + +private: + void Reset() {m_s1 = 1; m_s2 = 0;} + + word16 m_s1, m_s2; +}; + +NAMESPACE_END + +#endif |