summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2008-04-18 21:57:47 +0000
committerishmal <ishmal@users.sourceforge.net>2008-04-18 21:57:47 +0000
commit4736aa40ab985dfb0dc5619f998d5a7721a32fd4 (patch)
treecd90b74fea90d6061f48b9571648b5191e991921 /src
parentRemoved unnecessary checks from curve.cpp (sp_bpath_check_subpath and friends... (diff)
downloadinkscape-4736aa40ab985dfb0dc5619f998d5a7721a32fd4.tar.gz
inkscape-4736aa40ab985dfb0dc5619f998d5a7721a32fd4.zip
Yet another md5 fix for 32/64. This time it works on ppc64/gcc
(bzr r5474)
Diffstat (limited to 'src')
-rw-r--r--src/pedro/pedroutil.cpp5
1 files 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<<s | w>>(32-s), w += x )
+ ( w += (f(x, y, z) + data), M(w), w = w<<s | w>>(32-s), w += x, M(w) )
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to