From: Hamatoma Date: Sat, 28 Feb 2015 11:58:55 +0000 (+0100) Subject: MD5 optimizations X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=580df5688a2d5f1e2cf1a13af4ed11cbd6397e72;p=crepublib MD5 optimizations --- diff --git a/base/rebase.hpp b/base/rebase.hpp index 3a6e606..c368f92 100644 --- a/base/rebase.hpp +++ b/base/rebase.hpp @@ -20,8 +20,8 @@ #include #include #include -//#define __LITTLE_ENDIAN__ -#define __BIG_ENDIAN__ +#define __LITTLE_ENDIAN__ +//#define __BIG_ENDIAN__ #if defined __linux__ diff --git a/cunit/cuReMD5.cpp b/cunit/cuReMD5.cpp index 2df9386..04fb2bd 100644 --- a/cunit/cuReMD5.cpp +++ b/cunit/cuReMD5.cpp @@ -18,25 +18,10 @@ public: } private: void run(){ + testBase(); testSpeed(); testLong(); testBig(); - //testOld(); - testBase(); - } - void testOld(){ -#if 0 - MD5 md5; - const char* text = "The quick brown fox jumps over the lazy dog"; - text = "01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVEXYZ01234567890\n"; - - md5.update(text, strlen(text)); - md5.finalize(); - std::string dig = md5.hexdigest(); - const char* dig2 = (const char*) dig.c_str(); - printf ("%s:\n%s\n", text, dig.c_str()); - dig2++; -#endif } void testBase(){ ReMD5 md5; diff --git a/math/ReMD5.cpp b/math/ReMD5.cpp index 89d43dc..00ed16e 100644 --- a/math/ReMD5.cpp +++ b/math/ReMD5.cpp @@ -16,6 +16,7 @@ const int ReMD5::m_s[64] = { 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21 }; +static int s_ix = 0; // for x in [1..64] : int(2**32 * sin(x)) const uint32_t ReMD5::m_K[64] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, @@ -160,8 +161,10 @@ void ReMD5::processChunk2(const uint8_t block[64]){ uint32_t M[16]; // break chunk into sixteen 32-bit words M[j], 0 ≤ j ≤ 15 #ifdef __LITTLE_ENDIAN__ - for (int ix = 0; ix < 16; ix++) + for (int ix = 0; ix < 16; ix++){ memcpy(&M[ix], block + ix * 4, 4); + //M[ix] = * (uint32_t*) (block + ix*4); + } #elif defined __BIG_ENDIAN__ for (int ix = 0; ix < 16; ix++){ uint32_t x = block[3]; @@ -188,31 +191,35 @@ void ReMD5::processChunk2(const uint8_t block[64]){ #endif for (int i = 0; i < 64; i++){ #if defined TRACE_MD5 - if (i > 60) + if (i < 8) printf("%2d: A: %08x B: %08x C: %08x D%08x\n", i, A, B, C, D); #endif if (i < 16){ -# define F1(B, C, D, sh) F = (B & C) | (~ B & D); g = sh +# define F1(B, C, D) ((B & C) | (~ B & D)) // F := (B and C) or ((not B) and D) - F1(B, C, D, i); + F = F1(B, C, D); + g = i; } else if (i < 32){ // F := (D and B) or (C and (not D)) // g := (5×i + 1) mod 16 -# define F2(B, C, D, sh) F = (D & B) | (C & ~ D); g = sh - F2(B, C, D, (5*i + 1) % 16); +# define F2(B, C, D) ((D & B) | (C & ~ D)) + F = F2(B, C, D); + g = (5*i + 1) % 16; } else if (i < 48){ // F := B xor C xor D // g := (3×i + 5) mod 16 -# define F3(B, C, D, sh) F = (B ^ C) ^ D; g = sh - F3(B, C, D, (3*i + 5) % 16); +# define F3(B, C, D) ((B ^ C) ^ D) + F = F3(B, C, D); + g = (3*i + 5) % 16; } else { // F := C xor (B or (not D)) -# define F4(B, C, D, sh) F = C ^ (B | ~ D); g = sh +# define F4(B, C, D) (C ^ (B | ~ D)) // g := (7×i) mod 16 - F4(B, C, D, (7*i) % 16); + F = F4(B, C, D); + g = (7*i) % 16; } #if defined TRACE_MD5 - if (i > 60) + if (i < 8) printf(" K[%2d]: %08x M[%2d]: %08x shift: %02d\n", i, m_K[i], g, M[g], m_s[i]); #endif @@ -233,61 +240,50 @@ void ReMD5::processChunk2(const uint8_t block[64]){ } /** ---------------------- */ -inline uint32_t F(uint32_t x, uint32_t y, uint32_t z) { - return x&y | ~x&z; -} - -inline uint32_t G(uint32_t x, uint32_t y, uint32_t z) { - return x&z | y&~z; -} - -inline uint32_t H(uint32_t x, uint32_t y, uint32_t z) { - return x^y^z; -} - -inline uint32_t I(uint32_t x, uint32_t y, uint32_t z) { - return y ^ (x | ~z); -} inline uint32_t rotate_left(uint32_t x, int n) { return (x << n) | (x >> (32-n)); } -inline void FF(uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t ac) { +inline void X1(uint32_t &var, uint32_t x, uint32_t y, uint32_t z, + uint32_t data, uint32_t aConst, uint32_t shift) { //#define TRACE_MD5 #if defined TRACE_MD5 - printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, a, b, c, d); + printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, var, x, y, z); printf(" K[%2d]: %08x M[?]: %08x shift: %02d\n", - s_ix - 1, ac, x, s); + s_ix - 1, aConst, data, shift); #endif - a = rotate_left(a+ F(b,c,d) + x + ac, s) + b; + var = rotate_left(var+ F1(x, y, z) + data + aConst, shift) + x; } -inline void GG(uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t ac) { +inline void X2(uint32_t& var, uint32_t x, uint32_t y, uint32_t z, + uint32_t data, uint32_t aConst, uint32_t shift) { #if defined TRACE_MD5 - printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, a, b, c, d); + printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, var, x, y, z); printf(" K[%2d]: %08x M[?]: %08x shift: %02d\n", - s_ix - 1, ac, x, s); + s_ix - 1, aConst, data, shift); #endif - a = rotate_left(a + G(b,c,d) + x + ac, s) + b; + var = rotate_left(var + F2(x, y, z) + data + aConst, shift) + x; } -inline void HH(uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t ac) { +inline void X3(uint32_t& var, uint32_t x, uint32_t y, uint32_t z, + uint32_t data, uint32_t aConst, uint32_t shift) { #if defined TRACE_MD5 - printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, a, b, c, d); + printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, var, x, y, z); printf(" K[%2d]: %08x M[?]: %08x shift: %02d\n", - s_ix - 1, ac, x, s); + s_ix - 1, aConst, data, shift); #endif - a = rotate_left(a + H(b,c,d) + x + ac, s) + b; + var = rotate_left(var + F3(x, y, z) + data + aConst, shift) + x; } -inline void II(uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t ac) { +inline void X4(uint32_t& var, uint32_t x, uint32_t y, uint32_t z, + uint32_t data, uint32_t aConst, uint32_t shift) { #if defined TRACE_MD5 - printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, a, b, c, d); + printf("%2d: A: %08x B: %08x C: %08x D%08x\n", s_ix++ % 16, var, x, y, z); printf(" K[%2d]: %08x M[?]: %08x shift: %02d\n", - s_ix - 1, ac, x, s); + s_ix - 1, aConst, data, shift); #endif - a = rotate_left(a + I(b,c,d) + x + ac, s) + b; + var = rotate_left(var + F4(x, y, z) + data + aConst, shift) + x; } /** * Processes a 512 bit block ("chunk"). @@ -296,8 +292,10 @@ void ReMD5::processChunk(const uint8_t block[64]){ uint32_t M[16]; // break chunk into sixteen 32-bit words M[j], 0 ≤ j ≤ 15 #ifdef __LITTLE_ENDIAN__ - for (int ix = 0; ix < 16; ix++) - memcpy(&M[ix], block + ix * 4, 4); + for (int ix = 0; ix < 16; ix++){ + //memcpy(&M[ix], block + ix * 4, 4); + M[ix] = * (uint32_t*) (block + ix*4); + } #elif defined __BIG_ENDIAN__ for (int ix = 0; ix < 16; ix++){ uint32_t x = block[3]; @@ -315,183 +313,109 @@ void ReMD5::processChunk(const uint8_t block[64]){ uint32_t B = m_b0; uint32_t C = m_c0; uint32_t D = m_d0; - //Main loop: - - int F, g; - // B := B + leftrotate((A + F + K[i] + M[g]), s[i]) -# define F20(B, C, D, n) F = (B & C) | (~ B & D); g = n -// FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ -// F(uint32_t x, uint32_t y, uint32_t z) { -// return x&y | ~x&z; -// void MD5::FF(uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t ac) { -// a = rotate_left(a+ F(b,c,d) + x + ac, s) + b; -// D := C; -// C := B; -// B := B + leftrotate((A + F + K[i] + M[g]), s[i]) -// A := D(old) -// (D, C, B, A) = (C, B, B + leftrotate((A + F + K[i] + M[g]), s[i]), D) -// (A, B, C, D) = (D, B + leftrotate((A + F + K[i] + M[g]), s[i]), B, A) -# define X0(A, B, C, D, n) A = rotate_left(A + F0(A, B, C, D, n)) -# define F21(B, C, D, n) F = (D & B) | (C & ~ D); g = (5*n + 1) % 16 -# define F22(B, C, D, n) F = (B ^ C) ^ D; g = (5*n + 1) % 16 -# define F23(B, C, D, n) F = C ^ (B | ~ D); g = (3*n + 5) % 16 #if 0 - F20(B, C, D, 0); - F20(B, C, D, 1); - F20(B, C, D, 2); - F20(B, C, D, 3); - F20(B, C, D, 4); - F20(B, C, D, 5); - F20(B, C, D, 6); - F20(B, C, D, 7); - F20(B, C, D, 8); - F20(B, C, D, 9); - F20(B, C, D, 10); - F20(B, C, D, 11); - F20(B, C, D, 12); - F20(B, C, D, 13); - F20(B, C, D, 14); - F20(B, C, D, 15); - - F21(B, C, D, 16); - F21(B, C, D, 17); - F21(B, C, D, 18); - F21(B, C, D, 19); - F21(B, C, D, 20); - F21(B, C, D, 21); - F21(B, C, D, 22); - F21(B, C, D, 23); - F21(B, C, D, 24); - F21(B, C, D, 25); - F21(B, C, D, 26); - F21(B, C, D, 27); - F21(B, C, D, 28); - F21(B, C, D, 29); - F21(B, C, D, 30); - F21(B, C, D, 31); - - F22(B, C, D, 32); - F22(B, C, D, 33); - F22(B, C, D, 34); - F22(B, C, D, 35); - F22(B, C, D, 36); - F22(B, C, D, 37); - F22(B, C, D, 38); - F22(B, C, D, 39); - F22(B, C, D, 40); - F22(B, C, D, 41); - F22(B, C, D, 42); - F22(B, C, D, 43); - F22(B, C, D, 44); - F22(B, C, D, 45); - F22(B, C, D, 46); - F22(B, C, D, 47); - - F23(B, C, D, 48); - F23(B, C, D, 49); - F23(B, C, D, 50); - F23(B, C, D, 51); - F23(B, C, D, 52); - F23(B, C, D, 53); - F23(B, C, D, 54); - F23(B, C, D, 55); - F23(B, C, D, 56); - F23(B, C, D, 57); - F23(B, C, D, 58); - F23(B, C, D, 59); - F23(B, C, D, 60); - F23(B, C, D, 61); - F23(B, C, D, 62); - F23(B, C, D, 63); + // B := B + leftrotate((A + F + K[i] + M[g]), s[i]) + // D := C; + // C := B; + // B := B + leftrotate((A + F + K[i] + M[g]), s[i]) + // A := D(old) + // (D, C, B, A) = (C, B, B + leftrotate((A + F + K[i] + M[g]), s[i]), D) + // ==> (A, B, C, D) = (D, B + leftrotate((A + F + K[i] + M[g]), s[i]), B, A) + // The unrolled loop: + //i = g = 0; + (A, B, C, D) = (D, B + leftrotate((A + F1(B, C, D) + K[0] + M[0]), s[0]), B, A) + // only one var must be calculated, the other 3 are exchanged only. + //i = g = 1; + (A, B, C, D) = (D, B + leftrotate((A + F1(B, C, D) + K[1] + M[1]), s[1]), B, A) + //i = g = 2; + (A, B, C, D) = (D, B + leftrotate((A + F1(B, C, D) + K[2] + M[2]), s[2]), B, A) + //i = g = 3; + (A, B, C, D) = (D, B + leftrotate((A + F1(B, C, D) + K[3] + M[3]), s[3]), B, A) + // in each of the 4 statements another variable (of A, B, C and D) will be calculated + // so we do not exchange in each step, we calculate in the end position + // we define a function to do this: + void X1(uint32_t &var, uint32_t x, uint32_t y, uint32_t z, uint32_t data, uint32_t shift, uint32_t aConst){ + var = rotate_left(var+ F1(x, y, z) + data + aConst, shift) + x; + } + // note: the input parameter of of X1 must respect the exchange: + // A -> D -> C -> B ... + X1(A, B, C, D, M[0], K[0], s[0]); + X1(D, A, B, C, M[1], K[1], s[1]); + X1(C, D, A, B, M[2], K[2], s[2]); + X1(B, C, D, A, M[3], K[3], s[3]); + // ... #endif -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - - /* Round 1 */ - FF (A, B, C, D, M[ 0], S11, 0xd76aa478); /* 1 */ - FF (D, A, B, C, M[ 1], S12, 0xe8c7b756); /* 2 */ - FF (C, D, A, B, M[ 2], S13, 0x242070db); /* 3 */ - FF (B, C, D, A, M[ 3], S14, 0xc1bdceee); /* 4 */ - FF (A, B, C, D, M[ 4], S11, 0xf57c0faf); /* 5 */ - FF (D, A, B, C, M[ 5], S12, 0x4787c62a); /* 6 */ - FF (C, D, A, B, M[ 6], S13, 0xa8304613); /* 7 */ - FF (B, C, D, A, M[ 7], S14, 0xfd469501); /* 8 */ - FF (A, B, C, D, M[ 8], S11, 0x698098d8); /* 9 */ - FF (D, A, B, C, M[ 9], S12, 0x8b44f7af); /* 10 */ - FF (C, D, A, B, M[10], S13, 0xffff5bb1); /* 11 */ - FF (B, C, D, A, M[11], S14, 0x895cd7be); /* 12 */ - FF (A, B, C, D, M[12], S11, 0x6b901122); /* 13 */ - FF (D, A, B, C, M[13], S12, 0xfd987193); /* 14 */ - FF (C, D, A, B, M[14], S13, 0xa679438e); /* 15 */ - FF (B, C, D, A, M[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG (A, B, C, D, M[ 1], S21, 0xf61e2562); /* 17 */ - GG (D, A, B, C, M[ 6], S22, 0xc040b340); /* 18 */ - GG (C, D, A, B, M[11], S23, 0x265e5a51); /* 19 */ - GG (B, C, D, A, M[ 0], S24, 0xe9b6c7aa); /* 20 */ - GG (A, B, C, D, M[ 5], S21, 0xd62f105d); /* 21 */ - GG (D, A, B, C, M[10], S22, 0x2441453); /* 22 */ - GG (C, D, A, B, M[15], S23, 0xd8a1e681); /* 23 */ - GG (B, C, D, A, M[ 4], S24, 0xe7d3fbc8); /* 24 */ - GG (A, B, C, D, M[ 9], S21, 0x21e1cde6); /* 25 */ - GG (D, A, B, C, M[14], S22, 0xc33707d6); /* 26 */ - GG (C, D, A, B, M[ 3], S23, 0xf4d50d87); /* 27 */ - GG (B, C, D, A, M[ 8], S24, 0x455a14ed); /* 28 */ - GG (A, B, C, D, M[13], S21, 0xa9e3e905); /* 29 */ - GG (D, A, B, C, M[ 2], S22, 0xfcefa3f8); /* 30 */ - GG (C, D, A, B, M[ 7], S23, 0x676f02d9); /* 31 */ - GG (B, C, D, A, M[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH (A, B, C, D, M[ 5], S31, 0xfffa3942); /* 33 */ - HH (D, A, B, C, M[ 8], S32, 0x8771f681); /* 34 */ - HH (C, D, A, B, M[11], S33, 0x6d9d6122); /* 35 */ - HH (B, C, D, A, M[14], S34, 0xfde5380c); /* 36 */ - HH (A, B, C, D, M[ 1], S31, 0xa4beea44); /* 37 */ - HH (D, A, B, C, M[ 4], S32, 0x4bdecfa9); /* 38 */ - HH (C, D, A, B, M[ 7], S33, 0xf6bb4b60); /* 39 */ - HH (B, C, D, A, M[10], S34, 0xbebfbc70); /* 40 */ - HH (A, B, C, D, M[13], S31, 0x289b7ec6); /* 41 */ - HH (D, A, B, C, M[ 0], S32, 0xeaa127fa); /* 42 */ - HH (C, D, A, B, M[ 3], S33, 0xd4ef3085); /* 43 */ - HH (B, C, D, A, M[ 6], S34, 0x4881d05); /* 44 */ - HH (A, B, C, D, M[ 9], S31, 0xd9d4d039); /* 45 */ - HH (D, A, B, C, M[12], S32, 0xe6db99e5); /* 46 */ - HH (C, D, A, B, M[15], S33, 0x1fa27cf8); /* 47 */ - HH (B, C, D, A, M[ 2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II (A, B, C, D, M[ 0], S41, 0xf4292244); /* 49 */ - II (D, A, B, C, M[ 7], S42, 0x432aff97); /* 50 */ - II (C, D, A, B, M[14], S43, 0xab9423a7); /* 51 */ - II (B, C, D, A, M[ 5], S44, 0xfc93a039); /* 52 */ - II (A, B, C, D, M[12], S41, 0x655b59c3); /* 53 */ - II (D, A, B, C, M[ 3], S42, 0x8f0ccc92); /* 54 */ - II (C, D, A, B, M[10], S43, 0xffeff47d); /* 55 */ - II (B, C, D, A, M[ 1], S44, 0x85845dd1); /* 56 */ - II (A, B, C, D, M[ 8], S41, 0x6fa87e4f); /* 57 */ - II (D, A, B, C, M[15], S42, 0xfe2ce6e0); /* 58 */ - II (C, D, A, B, M[ 6], S43, 0xa3014314); /* 59 */ - II (B, C, D, A, M[13], S44, 0x4e0811a1); /* 60 */ - II (A, B, C, D, M[ 4], S41, 0xf7537e82); /* 61 */ - II (D, A, B, C, M[11], S42, 0xbd3af235); /* 62 */ - II (C, D, A, B, M[ 2], S43, 0x2ad7d2bb); /* 63 */ - II (B, C, D, A, M[ 9], S44, 0xeb86d391); /* 64 */ + /* Round 1 */ + X1(A, B, C, D, M[ 0], 0xd76aa478, 7); + X1(D, A, B, C, M[ 1], 0xe8c7b756, 12); + X1(C, D, A, B, M[ 2], 0x242070db, 17); + X1(B, C, D, A, M[ 3], 0xc1bdceee, 22); + X1(A, B, C, D, M[ 4], 0xf57c0faf, 7); + X1(D, A, B, C, M[ 5], 0x4787c62a, 12); + X1(C, D, A, B, M[ 6], 0xa8304613, 17); + X1(B, C, D, A, M[ 7], 0xfd469501, 22); + X1(A, B, C, D, M[ 8], 0x698098d8, 7); + X1(D, A, B, C, M[ 9], 0x8b44f7af, 12); + X1(C, D, A, B, M[10], 0xffff5bb1, 17); + X1(B, C, D, A, M[11], 0x895cd7be, 22); + X1(A, B, C, D, M[12], 0x6b901122, 7); + X1(D, A, B, C, M[13], 0xfd987193, 12); + X1(C, D, A, B, M[14], 0xa679438e, 17); + X1(B, C, D, A, M[15], 0x49b40821, 22); + + /* Round 2 */ + X2 (A, B, C, D, M[ 1], 0xf61e2562, 5); + X2 (D, A, B, C, M[ 6], 0xc040b340, 9); + X2 (C, D, A, B, M[11], 0x265e5a51, 14); + X2 (B, C, D, A, M[ 0], 0xe9b6c7aa, 20); + X2 (A, B, C, D, M[ 5], 0xd62f105d, 5); + X2 (D, A, B, C, M[10], 0x2441453, 9); + X2 (C, D, A, B, M[15], 0xd8a1e681, 14); + X2 (B, C, D, A, M[ 4], 0xe7d3fbc8, 20); + X2 (A, B, C, D, M[ 9], 0x21e1cde6, 5); + X2 (D, A, B, C, M[14], 0xc33707d6, 9); + X2 (C, D, A, B, M[ 3], 0xf4d50d87, 14); + X2 (B, C, D, A, M[ 8], 0x455a14ed, 20); + X2 (A, B, C, D, M[13], 0xa9e3e905, 5); + X2 (D, A, B, C, M[ 2], 0xfcefa3f8, 9); + X2 (C, D, A, B, M[ 7], 0x676f02d9, 14); + X2 (B, C, D, A, M[12], 0x8d2a4c8a, 20); + + /* Round 3 */ + X3 (A, B, C, D, M[ 5], 0xfffa3942, 4); + X3 (D, A, B, C, M[ 8], 0x8771f681, 11); + X3 (C, D, A, B, M[11], 0x6d9d6122, 16); + X3 (B, C, D, A, M[14], 0xfde5380c, 23); + X3 (A, B, C, D, M[ 1], 0xa4beea44, 4); + X3 (D, A, B, C, M[ 4], 0x4bdecfa9, 11); + X3 (C, D, A, B, M[ 7], 0xf6bb4b60, 16); + X3 (B, C, D, A, M[10], 0xbebfbc70, 23); + X3 (A, B, C, D, M[13], 0x289b7ec6, 4); + X3 (D, A, B, C, M[ 0], 0xeaa127fa, 11); + X3 (C, D, A, B, M[ 3], 0xd4ef3085, 16); + X3 (B, C, D, A, M[ 6], 0x4881d05, 23); + X3 (A, B, C, D, M[ 9], 0xd9d4d039, 4); + X3 (D, A, B, C, M[12], 0xe6db99e5, 11); + X3 (C, D, A, B, M[15], 0x1fa27cf8, 16); + X3 (B, C, D, A, M[ 2], 0xc4ac5665, 23); + + /* Round 4 */ + X4 (A, B, C, D, M[ 0], 0xf4292244, 6); + X4 (D, A, B, C, M[ 7], 0x432aff97, 10); + X4 (C, D, A, B, M[14], 0xab9423a7, 15); + X4 (B, C, D, A, M[ 5], 0xfc93a039, 21); + X4 (A, B, C, D, M[12], 0x655b59c3, 6); + X4 (D, A, B, C, M[ 3], 0x8f0ccc92, 10); + X4 (C, D, A, B, M[10], 0xffeff47d, 15); + X4 (B, C, D, A, M[ 1], 0x85845dd1, 21); + X4 (A, B, C, D, M[ 8], 0x6fa87e4f, 6); + X4 (D, A, B, C, M[15], 0xfe2ce6e0, 10); + X4 (C, D, A, B, M[ 6], 0xa3014314, 15); + X4 (B, C, D, A, M[13], 0x4e0811a1, 21); + X4 (A, B, C, D, M[ 4], 0xf7537e82, 6); + X4 (D, A, B, C, M[11], 0xbd3af235, 10); + X4 (C, D, A, B, M[ 2], 0x2ad7d2bb, 15); + X4 (B, C, D, A, M[ 9], 0xeb86d391, 21); //Add this chunk's hash to result so far: m_a0 += A; diff --git a/os/ReDirTools.cpp b/os/ReDirTools.cpp index a2e92da..06e94d9 100644 --- a/os/ReDirTools.cpp +++ b/os/ReDirTools.cpp @@ -1956,7 +1956,7 @@ ReDirWhich::ReDirWhich(ReLogger* logger) : void ReDirWhich::doIt(){ ReByteBuffer value, path; bool all = false; - ReStringList items; + ReStringList items; char sep = 0; m_programArgs.getString("list", path); if (path.length() == 0){