summaryrefslogtreecommitdiff
path: root/lib/sha1.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-03-15 15:24:39 +0100
committerJim Meyering <meyering@redhat.com>2008-03-15 15:24:39 +0100
commitfdc2a18856ce9690d412a7c357c72f69832ec54c (patch)
tree7737158bc9a4d9ec7893b422b4f48944219cb4cf /lib/sha1.c
parent7307a7b63205ee9bf5791e5f7ed59be6a40cfc32 (diff)
downloadgnulib-fdc2a18856ce9690d412a7c357c72f69832ec54c.tar.gz
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. * lib/md5.c (md5_process_bytes): Likewise.
Diffstat (limited to 'lib/sha1.c')
-rw-r--r--lib/sha1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sha1.c b/lib/sha1.c
index 9c6c7ae393..67d5c964c6 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)
{
- sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
-
ctx->buflen &= 63;
+ sha1_process_block (ctx->buffer, ctx->buflen, ctx);
+
/* The regions in the following copy operation cannot overlap. */
memcpy (ctx->buffer,
&((char *) ctx->buffer)[(left_over + add) & ~63],