summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2005-03-07 18:14:22 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-07 18:14:22 -0800
commit567200b8fba50573de44bc6f4e71572bb8c5e987 (patch)
tree00136bb350e56e145ab707518ca81c637d4f10f9 /lib
parent3ced79bdd08d2826eed9342bda625c8198638e2f (diff)
[PATCH] random: Kill duplicate halfmd4 in ext3 htree
Replace duplicate halfMD4 code with call to lib/ Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/halfmd4.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/halfmd4.c b/lib/halfmd4.c
index 31009bcc9d92..e11db26f8ae5 100644
--- a/lib/halfmd4.c
+++ b/lib/halfmd4.c
@@ -22,7 +22,7 @@
/*
* Basic cut-down MD4 transform. Returns only 32 bits of result.
*/
-__u32 half_md4_transform(__u32 const buf[4], __u32 const in[8])
+__u32 half_md4_transform(__u32 buf[4], __u32 const in[8])
{
__u32 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
@@ -56,7 +56,11 @@ __u32 half_md4_transform(__u32 const buf[4], __u32 const in[8])
ROUND(H, c, d, a, b, in[0] + K3, 11);
ROUND(H, b, c, d, a, in[4] + K3, 15);
- return buf[1] + b; /* "most hashed" word */
- /* Alternative: return sum of all words? */
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
+
+ return buf[1]; /* "most hashed" word */
}
EXPORT_SYMBOL(half_md4_transform);