From: Jim Meyering Date: Sat, 15 Mar 2008 15:06:44 +0000 (+0100) Subject: Undo last change. X-Git-Tag: v0.1~7659 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=a20403123cca92c457751f335d502bdf1c36b6f7;p=gnulib.git Undo last change. * lib/sha1.c, lib/md5.c: 63 != ~63. Reported by Andreas Schwab. --- diff --git a/ChangeLog b/ChangeLog index 97d711f4c..d1ad022dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-03-15 Jim Meyering + Undo last change. + * lib/sha1.c, lib/md5.c: 63 != ~63. + Reported by Andreas Schwab. + sha1.c, md5.c: Hoist a redundant expression. * lib/sha1.c (sha1_process_bytes): AND-off the low bits in "ctx->buflen" only once, before calling *_process_block. diff --git a/lib/md5.c b/lib/md5.c index ce02a2621..2213dc120 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -230,9 +230,9 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) if (ctx->buflen > 64) { - ctx->buflen &= 63; - md5_process_block (ctx->buffer, ctx->buflen, ctx); + md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx); + ctx->buflen &= 63; /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &((char *) ctx->buffer)[(left_over + add) & ~63], diff --git a/lib/sha1.c b/lib/sha1.c index 67d5c964c..9c6c7ae39 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -217,9 +217,9 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx) if (ctx->buflen > 64) { - ctx->buflen &= 63; - sha1_process_block (ctx->buffer, ctx->buflen, ctx); + sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx); + ctx->buflen &= 63; /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &((char *) ctx->buffer)[(left_over + add) & ~63],