Botan 1.10.17
md2.h
Go to the documentation of this file.
1/*
2* MD2
3* (C) 1999-2007 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_MD2_H__
9#define BOTAN_MD2_H__
10
11#include <botan/hash.h>
12
13namespace Botan {
14
15/**
16* MD2
17*/
18class BOTAN_DLL MD2 : public HashFunction
19 {
20 public:
21 std::string name() const { return "MD2"; }
22 size_t output_length() const { return 16; }
23 size_t hash_block_size() const { return 16; }
24 HashFunction* clone() const { return new MD2; }
25
26 void clear();
27
28 MD2() : X(48), checksum(16), buffer(16)
29 { clear(); }
30 private:
31 void add_data(const byte[], size_t);
32 void hash(const byte[]);
33 void final_result(byte[]);
34
35 SecureVector<byte> X, checksum, buffer;
36 size_t position;
37 };
38
39}
40
41#endif
std::string name() const
Definition md2.h:21
size_t output_length() const
Definition md2.h:22
void clear()
Definition md2.cpp:105
HashFunction * clone() const
Definition md2.h:24
MD2()
Definition md2.h:28
size_t hash_block_size() const
Definition md2.h:23