Undo last change.
authorJim Meyering <meyering@redhat.com>
Sat, 15 Mar 2008 15:06:44 +0000 (16:06 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 15 Mar 2008 15:06:44 +0000 (16:06 +0100)
* lib/sha1.c, lib/md5.c: 63 != ~63.
Reported by Andreas Schwab.

ChangeLog
lib/md5.c
lib/sha1.c

index 97d711f..d1ad022 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-03-15  Jim Meyering  <meyering@redhat.com>
 
+       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.
index ce02a26..2213dc1 100644 (file)
--- 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],
index 67d5c96..9c6c7ae 100644 (file)
@@ -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],