diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-12 05:40:19 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-12 05:40:19 +0000 |
commit | d6471083ad248f2f9b607ae07fd7768f290b1758 (patch) | |
tree | e1751d25a058764519f22ac545639a60363d5625 /lib/md5.c | |
parent | 420153e431a6b9c04ad4fd15896eac1d7c2f92ef (diff) | |
download | gnulib-d6471083ad248f2f9b607ae07fd7768f290b1758.tar.gz |
Sync from coreutils.
* md5.c: Fix commentary typos.
(OP): Fix spacing.
(alignof, UNALIGNED_P): No need for a GCC-specific version.
* md5.h (__attribute__): Remove; unused.
* sha1.c: Fix commentary to match md5 better.
* sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
so that we don't need to worry about alignment. All uses changed.
This merges the 2005-10-28 md5 change into sha1.
Diffstat (limited to 'lib/md5.c')
-rw-r--r-- | lib/md5.c | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -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,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -86,7 +86,7 @@ md5_init_ctx (struct md5_ctx *ctx) must be in little endian byte order. IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ + aligned for a 32-bit value. */ void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) { @@ -102,7 +102,7 @@ md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ + aligned for a 32-bit value. */ void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) { @@ -245,14 +245,8 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) if (len >= 64) { #if !_STRING_ARCH_unaligned -/* To check alignment gcc has an appropriate operator. Other - compilers don't. */ -# if __GNUC__ >= 2 -# define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint32_t) != 0) -# else -# define alignof(type) offsetof (struct { char c; type x; }, x) -# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0) -# endif +# define alignof(type) offsetof (struct { char c; type x; }, x) +# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0) if (UNALIGNED_P (buffer)) while (len > 64) { @@ -382,7 +376,7 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) argument specifying the function to use. */ #undef OP #define OP(f, a, b, c, d, k, s, T) \ - do \ + do \ { \ a += f (b, c, d) + correct_words[k] + T; \ CYCLIC (a, s); \ |