projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename sysexits_.h to sysexits.in.h.
[gnulib.git]
/
lib
/
sha1.c
diff --git
a/lib/sha1.c
b/lib/sha1.c
index
0bc29b4
..
035f898
100644
(file)
--- a/
lib/sha1.c
+++ b/
lib/sha1.c
@@
-23,9
+23,7
@@
Robert Klep <robert@ilse.nl> -- Expansion function fix
*/
Robert Klep <robert@ilse.nl> -- Expansion function fix
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "sha1.h"
#include "sha1.h"
@@
-181,7
+179,7
@@
sha1_stream (FILE *stream, void *resblock)
return 0;
}
return 0;
}
-/* Compute
MD5
message digest for LEN bytes beginning at BUFFER. The
+/* Compute
SHA1
message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
@@
-270,10
+268,10
@@
sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
/* --- Code below is the primary difference between md5.c and sha1.c --- */
/* SHA1 round constants */
/* --- Code below is the primary difference between md5.c and sha1.c --- */
/* SHA1 round constants */
-#define K1 0x5a827999
L
-#define K2 0x6ed9eba1
L
-#define K3 0x8f1bbcdc
L
-#define K4 0xca62c1d6
L
+#define K1 0x5a827999
+#define K2 0x6ed9eba1
+#define K3 0x8f1bbcdc
+#define K4 0xca62c1d6
/* Round functions. Note that F2 is the same as F4. */
#define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) )
/* Round functions. Note that F2 is the same as F4. */
#define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) )
@@
-305,7
+303,7
@@
sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
if (ctx->total[0] < len)
++ctx->total[1];
if (ctx->total[0] < len)
++ctx->total[1];
-#define rol(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
+#define rol(x, n) (((x) << (n)) | ((
uint32_t) (
x) >> (32 - (n))))
#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \
^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \
#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \
^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \