37 typedef unsigned char md5_byte_t;
38 typedef unsigned int md5_word_t;
47 void append(
const void* data,
int nbytes);
53 const md5_byte_t* getDigest();
65 md5_byte_t digest[16];
67 md5_word_t tmpBuf[16];
71 process(
const md5_byte_t data[64]);
74 ROTATE_LEFT(
const md5_word_t x,
const int n);
77 F(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
80 G(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
83 H(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
86 I(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
88 typedef md5_word_t (
MD5::*md5func)(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
91 SET(md5func func, md5_word_t& a, md5_word_t& b, md5_word_t& c,
92 md5_word_t& d,
const int k,
const int s,
97 MD5::ROTATE_LEFT(
const md5_word_t x,
const int n)
99 return ( (x<<n) | (x>>(32-n)) );
103 MD5::F(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
105 return ( (x&y) | (~x&z) );
109 MD5::G(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
111 return ( (x&z) | (y&~z) );
115 MD5::H(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
121 MD5::I(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
123 return ( y ^ (x|~z) );
127 MD5::SET(md5func func, md5_word_t& a, md5_word_t& b, md5_word_t& c,
128 md5_word_t& d,
const int k,
const int s,
131 md5_word_t t = a + (this->*func)(b,c,d) + X[k] + Ti;
132 a = ROTATE_LEFT(t, s) + b;