aboutsummaryrefslogtreecommitdiff
path: root/src/md5.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-13 23:30:44 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-13 23:30:44 +0000
commit8aa6cee7eed01384771e05ecb425e4df9da4687b (patch)
tree7fa362d28b683fa678d47dfc82248a8a3d0f3722 /src/md5.h
parentd8fe3868996c80cd3de775584fde730c32c309c9 (diff)
downloadlibbu++-8aa6cee7eed01384771e05ecb425e4df9da4687b.tar.gz
libbu++-8aa6cee7eed01384771e05ecb425e4df9da4687b.tar.bz2
libbu++-8aa6cee7eed01384771e05ecb425e4df9da4687b.tar.xz
libbu++-8aa6cee7eed01384771e05ecb425e4df9da4687b.zip
Md5 works really, really well. It's fast, and sexy, and awesome. Thanks david.
Diffstat (limited to 'src/md5.h')
-rw-r--r--src/md5.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/md5.h b/src/md5.h
index 0be65fd..60992ac 100644
--- a/src/md5.h
+++ b/src/md5.h
@@ -14,6 +14,8 @@ 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
18 * 1993.
17 *@author Mike Buland 19 *@author Mike Buland
18 */ 20 */
19 class Md5 : public Bu::CryptoHash 21 class Md5 : public Bu::CryptoHash
@@ -36,13 +38,16 @@ namespace Bu
36 /** 38 /**
37 * Compute one block of input data. 39 * Compute one block of input data.
38 */ 40 */
39 void compBlock( long *x, uint32_t *lsum ); 41 void compBlock( uint32_t *lsum, uint32_t *x );
40 void compCap( uint32_t *sumout ); 42 void compCap( uint32_t *sumout );
43
44 void _addData( uint8_t *target, int &iCurFill, const void *sData,
45 int iSize );
46 void _toLittleEndian( uint8_t *buf, uint32_t count );
41 47
42 uint32_t inbuf[16]; 48 uint8_t inbuf[64];
43 uint32_t iFill;
44 uint32_t sum[4]; 49 uint32_t sum[4];
45 uint64_t iBytes; 50 uint32_t uBits[2];
46 }; 51 };
47}; 52};
48 53