diff options
Diffstat (limited to 'src/stable/md5.h')
-rw-r--r-- | src/stable/md5.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/stable/md5.h b/src/stable/md5.h index cb7d396..8845082 100644 --- a/src/stable/md5.h +++ b/src/stable/md5.h | |||
@@ -12,43 +12,43 @@ | |||
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
15 | /** | 15 | /** |
16 | * Class for easily calculating MD5 sums of just about any data. | 16 | * Class for easily calculating MD5 sums of just about any data. |
17 | * This code is based on some public domain code written by Colin Plumb in | 17 | * This code is based on some public domain code written by Colin Plumb in |
18 | * 1993. | 18 | * 1993. |
19 | *@author Mike Buland | 19 | *@author Mike Buland |
20 | */ | 20 | */ |
21 | class Md5 : public Bu::CryptoHash | 21 | class Md5 : public Bu::CryptoHash |
22 | { | 22 | { |
23 | public: | 23 | public: |
24 | /** Build an MD5 sum builder. */ | 24 | /** Build an MD5 sum builder. */ |
25 | Md5(); | 25 | Md5(); |
26 | 26 | ||
27 | /** Deconstruct */ | 27 | /** Deconstruct */ |
28 | virtual ~Md5(); | 28 | virtual ~Md5(); |
29 | 29 | ||
30 | virtual void reset(); | 30 | virtual void reset(); |
31 | virtual void setSalt( const Bu::String &sSalt ); | 31 | virtual void setSalt( const Bu::String &sSalt ); |
32 | virtual void addData( const void *sData, int iSize ); | 32 | virtual void addData( const void *sData, int iSize ); |
33 | using Bu::CryptoHash::addData; | 33 | using Bu::CryptoHash::addData; |
34 | virtual String getResult(); | 34 | virtual String getResult(); |
35 | virtual void writeResult( Bu::Stream &sOut ); | 35 | virtual void writeResult( Bu::Stream &sOut ); |
36 | 36 | ||
37 | private: | 37 | private: |
38 | /** | 38 | /** |
39 | * Compute one block of input data. | 39 | * Compute one block of input data. |
40 | */ | 40 | */ |
41 | void compBlock( uint32_t *lsum, uint32_t *x ); | 41 | void compBlock( uint32_t *lsum, uint32_t *x ); |
42 | void compCap( uint32_t *sumout ); | 42 | void compCap( uint32_t *sumout ); |
43 | 43 | ||
44 | void _addData( uint8_t *target, int &iCurFill, const void *sData, | 44 | void _addData( uint8_t *target, int &iCurFill, const void *sData, |
45 | int iSize ); | 45 | int iSize ); |
46 | void _toLittleEndian( uint8_t *buf, uint32_t count ); | 46 | void _toLittleEndian( uint8_t *buf, uint32_t count ); |
47 | 47 | ||
48 | uint8_t inbuf[64]; | 48 | uint8_t inbuf[64]; |
49 | uint32_t sum[4]; | 49 | uint32_t sum[4]; |
50 | uint32_t uBits[2]; | 50 | uint32_t uBits[2]; |
51 | }; | 51 | }; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | #endif | 54 | #endif |