summaryrefslogtreecommitdiff
path: root/security/mhash/files/patch-lib-ripemd.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/mhash/files/patch-lib-ripemd.c')
-rw-r--r--security/mhash/files/patch-lib-ripemd.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/security/mhash/files/patch-lib-ripemd.c b/security/mhash/files/patch-lib-ripemd.c
new file mode 100644
index 000000000000..77d52ca6ec52
--- /dev/null
+++ b/security/mhash/files/patch-lib-ripemd.c
@@ -0,0 +1,33 @@
+diff -urN -x .svn ../../branches/vendor/mhash/lib/ripemd.c ./lib/ripemd.c
+--- ../../branches/vendor/mhash/lib/ripemd.c 2008-01-16 14:26:51.000000000 +0200
++++ ./lib/ripemd.c 2008-01-16 15:02:04.000000000 +0200
+@@ -55,13 +55,13 @@
+ /* 32-bit rotate left - kludged with shifts */
+ #define ROTL(n,X) (((X)<<(n))|((X)>>(32-(n))))
+
+-#define f0(x,y,z) (x^y^z)
++#define f0(x,y,z) ((x)^(y)^(z))
+ //#define f16(x,y,z) ((x&y)|(~(x) & z))
+ #define f16(x,y,z) ((z)^((x)&((y)^(z))))
+-#define f32(x,y,z) ((x|~(y))^z)
++#define f32(x,y,z) (((x)|~(y))^(z))
+ //#define f48(x,y,z) ((x&z)|(y&~(z)))
+ #define f48(x,y,z) ((y)^((z)&((x)^(y))))
+-#define f64(x,y,z) (x^(y|(~z)))
++#define f64(x,y,z) ((x)^((y)|(~(z))))
+
+ #define K0 0x00000000
+ #define K1 0x5A827999 /* 2^30 * sqrt(2) */
+@@ -913,9 +913,9 @@
+ #define EXTRACT_UCHAR(p) (*(mutils_word8 *)(p))
+ #endif
+
+-#define STRING2INT(s) ((((((EXTRACT_UCHAR(s+3) << 8) \
+- | EXTRACT_UCHAR(s+2)) << 8) \
+- | EXTRACT_UCHAR(s+1)) << 8) \
++#define STRING2INT(s) ((((((EXTRACT_UCHAR((s)+3) << 8) \
++ | EXTRACT_UCHAR((s)+2)) << 8) \
++ | EXTRACT_UCHAR((s)+1)) << 8) \
+ | EXTRACT_UCHAR(s))
+
+ static void ripemd_block(struct ripemd_ctx *ctx, mutils_word8 *block)