39 typedef uint8_t md5_byte_t;
40 typedef uint32_t md5_word_t;
49 void append(
const void* data,
int nbytes);
55 const md5_byte_t* getDigest();
67 md5_byte_t digest[16];
69 md5_word_t tmpBuf[16];
73 process(
const md5_byte_t data[64]);
76 ROTATE_LEFT(
const md5_word_t x,
const int n);
79 F(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
82 G(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
85 H(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
88 I(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
90 typedef md5_word_t (
MD5::*md5func)(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z);
93 SET(md5func func, md5_word_t& a, md5_word_t& b, md5_word_t& c,
94 md5_word_t& d,
const int k,
const int s,
99 MD5::ROTATE_LEFT(
const md5_word_t x,
const int n)
101 return ( (x<<n) | (x>>(32-n)) );
105 MD5::F(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
107 return ( (x&y) | (~x&z) );
111 MD5::G(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
113 return ( (x&z) | (y&~z) );
117 MD5::H(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
123 MD5::I(
const md5_word_t x,
const md5_word_t y,
const md5_word_t z)
125 return ( y ^ (x|~z) );
129 MD5::SET(md5func func, md5_word_t& a, md5_word_t& b, md5_word_t& c,
130 md5_word_t& d,
const int k,
const int s,
133 md5_word_t t = a + (this->*func)(b,c,d) + X[k] + Ti;
134 a = ROTATE_LEFT(t, s) + b;