summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0921de3)
raw | patch | inline | side by side (parent: 0921de3)
author | ishmal <ishmal@users.sourceforge.net> | |
Fri, 18 Apr 2008 21:57:47 +0000 (21:57 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Fri, 18 Apr 2008 21:57:47 +0000 (21:57 +0000) |
src/pedro/pedroutil.cpp | patch | blob | history |
index 2197527fb44c5372bdd92acd2cb69e203e697e9f..43ff9748d6bd3f03311f49971bc080fbdeaa3cf9 100644 (file)
--- a/src/pedro/pedroutil.cpp
+++ b/src/pedro/pedroutil.cpp
//# 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)
// ## 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