1
by weidai
Initial revision |
1 |
#ifndef CRYPTOPP_ADLER32_H
|
2 |
#define CRYPTOPP_ADLER32_H
|
|
3 |
||
4 |
#include "cryptlib.h" |
|
5 |
||
6 |
NAMESPACE_BEGIN(CryptoPP) |
|
7 |
||
8 |
//! ADLER-32 checksum calculations
|
|
9 |
class Adler32 : public HashTransformation |
|
10 |
{
|
|
11 |
public: |
|
244
by weidai
port to Borland C++Builder 2006 |
12 |
CRYPTOPP_CONSTANT(DIGESTSIZE = 4) |
1
by weidai
Initial revision |
13 |
Adler32() {Reset();} |
184
by weidai
port to MSVC .NET 2005 beta 2 |
14 |
void Update(const byte *input, size_t length); |
15 |
void TruncatedFinal(byte *hash, size_t size); |
|
1
by weidai
Initial revision |
16 |
unsigned int DigestSize() const {return DIGESTSIZE;} |
417
by weidai
fix compile on ICC 11 |
17 |
static const char * StaticAlgorithmName() {return "Adler32";} |
18 |
std::string AlgorithmName() const {return StaticAlgorithmName();} |
|
1
by weidai
Initial revision |
19 |
|
20 |
private: |
|
21 |
void Reset() {m_s1 = 1; m_s2 = 0;} |
|
22 |
||
23 |
word16 m_s1, m_s2; |
|
24 |
};
|
|
25 |
||
26 |
NAMESPACE_END
|
|
27 |
||
28 |
#endif
|