1 // Copyright 2009 The Archiveopteryx Developers <info@aox.org>
2 
3 #ifndef MD5_H
4 #define MD5_H
5 
6 #include "global.h"
7 
8 
9 class EString;
10 class Buffer;
11 
12 
13 class MD5
14     : public Garbage
15 {
16 public:
17     MD5();
18 
19     void add( const char *, uint );
20     void add( const EString & );
21 
22     EString hash();
23     static EString hash( const EString & );
24     static EString hash( const Buffer & );
25     static EString HMAC( const EString &, const EString & );
26 
27 private:
28     bool finalised;
29     uint32 bits[2];
30     uint32 buf[4];
31     char in[64];
32 
33     void init();
34     void transform();
35 };
36 
37 
38 #endif
39