summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 476a4df)
raw | patch | inline | side by side (parent: 476a4df)
author | Paul Mackerras <paulus@samba.org> | |
Sun, 18 Jun 2006 23:25:16 +0000 (09:25 +1000) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 19 Jun 2006 03:12:20 +0000 (20:12 -0700) |
The PPC SHA1 routine had an overflow which meant that it gave
incorrect results for input buffers >= 512MB. This fixes it by
ensuring that the update of the total length in bits is done using
64-bit arithmetic.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
incorrect results for input buffers >= 512MB. This fixes it by
ensuring that the update of the total length in bits is done using
64-bit arithmetic.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
ppc/sha1.c | patch | blob | history |
diff --git a/ppc/sha1.c b/ppc/sha1.c
index 5ba4fc5259b063dab6417c142938d987ee894fc0..0820398b004dd8af93a25e7fa26be60cf4dda410 100644 (file)
--- a/ppc/sha1.c
+++ b/ppc/sha1.c
unsigned long nb;
const unsigned char *p = ptr;
- c->len += n << 3;
+ c->len += (uint64_t) n << 3;
while (n != 0) {
if (c->cnt || n < 64) {
nb = 64 - c->cnt;