From 41d421c82e4b106ef8bad3b5986be2994e0756c0 Mon Sep 17 00:00:00 2001 From: ishmal Date: Fri, 18 Apr 2008 21:57:47 +0000 Subject: [PATCH] Yet another md5 fix for 32/64. This time it works on ppc64/gcc --- src/pedro/pedroutil.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pedro/pedroutil.cpp b/src/pedro/pedroutil.cpp index 2197527fb..43ff9748d 100644 --- a/src/pedro/pedroutil.cpp +++ b/src/pedro/pedroutil.cpp @@ -650,7 +650,8 @@ DOMString Md5::finishHex() //# The four core functions - F1 is optimized somewhat -// #define F1(x, y, z) (x & y | ~x & z) +// #define F1(x, y, z) (x & y | ~x & z) +#define M(x) ((x) &= 0xffffffff) #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) @@ -658,7 +659,7 @@ DOMString Md5::finishHex() // ## This is the central step in the MD5 algorithm. #define MD5STEP(f, w, x, y, z, data, s) \ - ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) + ( w += (f(x, y, z) + data), M(w), w = w<>(32-s), w += x, M(w) ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to -- 2.30.2