summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7c208a)
raw | patch | inline | side by side (parent: d7c208a)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Aug 2009 20:56:19 +0000 (13:56 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Aug 2009 20:56:19 +0000 (13:56 -0700) |
Undo the change I picked up from the mailing list discussion suggested
by Nico, not because it is wrong, but it will be done at the end of the
follow-up series.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
by Nico, not because it is wrong, but it will be done at the end of the
follow-up series.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
block-sha1/sha1.c | patch | blob | history |
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c
index 50b2b42b03f255689b26cc91d7fb02ce5601dff2..eef32f7859e4f5cf9a0a4ba2a81d2f858f48daee 100644 (file)
--- a/block-sha1/sha1.c
+++ b/block-sha1/sha1.c
{
int lenW = ctx->lenW;
- ctx->size += len;
+ ctx->size += (unsigned long long) len << 3;
/* Read the data into W and process blocks as they get full
*/
/* Pad with a binary 1 (ie 0x80), then zeroes, then length
*/
- padlen[0] = htonl(ctx->size >> (32 - 3));
- padlen[1] = htonl(ctx->size << 3);
+ padlen[0] = htonl(ctx->size >> 32);
+ padlen[1] = htonl(ctx->size);
blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - ctx->lenW)));
blk_SHA1_Update(ctx, padlen, 8);