Botan: src/checksum/adler32/adler32.h Source File

Botan 1.10.17

adler32.h
Go to the documentation of this file.
1 /*
2 * Adler32
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_ADLER32_H__
9 #define BOTAN_ADLER32_H__
10
11 #include <botan/hash.h>
12
13 namespace Botan {
14
15 /**
16 * The Adler32 checksum, used in zlib
17 */
18 class BOTAN_DLL Adler32 : public HashFunction
19 {
20 public:
21 std::string name() const { return "Adler32"; }
22 size_t output_length() const { return 4; }
23 HashFunction* clone() const { return new Adler32; }
24
25 void clear() { S1 = 1; S2 = 0; }
26
27 Adler32() { clear(); }
28 ~Adler32() { clear(); }
29 private:
30 void add_data(const byte[], size_t);
31 void final_result(byte[]);
32 u16bit S1, S2;
33 };
34
35 }
36
37 #endif
Botan::Adler32
Definition: adler32.h:18
Botan::Adler32::output_length
size_t output_length() const
Definition: adler32.h:22
Botan::Adler32::clear
void clear()
Definition: adler32.h:25
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::Adler32::clone
HashFunction * clone() const
Definition: adler32.h:23
Botan::u16bit
unsigned short u16bit
Definition: types.h:27
Botan
Definition: algo_base.h:14
Botan::Adler32::name
std::string name() const
Definition: adler32.h:21
Botan::HashFunction
Definition: hash.h:20
Botan::Adler32::Adler32
Adler32()
Definition: adler32.h:27
Botan::Adler32::~Adler32
~Adler32()
Definition: adler32.h:28