diff options
Diffstat (limited to 'crypt/md5.c')
-rw-r--r-- | crypt/md5.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crypt/md5.c b/crypt/md5.c index 922e7cc..9bdb8e6 100644 --- a/crypt/md5.c +++ b/crypt/md5.c @@ -1,6 +1,6 @@ /* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995,1996,1997,1999,2000,2001,2005 + Copyright (C) 1995,1996,1997,1999,2000,2001,2005,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -123,9 +123,9 @@ md5_finish_ctx (ctx, resbuf) memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ - *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); - *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | - (ctx->total[0] >> 29)); + ctx->buffer32[(bytes + pad) / 4] = SWAP (ctx->total[0] << 3); + ctx->buffer32[(bytes + pad + 4) / 4] = SWAP ((ctx->total[1] << 3) | + (ctx->total[0] >> 29)); /* Process last bytes. */ md5_process_block (ctx->buffer, bytes + pad + 8, ctx); @@ -168,7 +168,7 @@ md5_stream (stream, resblock) } while (sum < BLOCKSIZE && n != 0); if (n == 0 && ferror (stream)) - return 1; + return 1; /* If end of file is reached, end the loop. */ if (n == 0) @@ -340,12 +340,12 @@ md5_process_block (buffer, len, ctx) #define OP(a, b, c, d, s, T) \ do \ - { \ + { \ a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ ++words; \ CYCLIC (a, s); \ a += b; \ - } \ + } \ while (0) /* It is unfortunate that C does not provide an operator for |