Mercurial > gnulib
annotate lib/sha1.c @ 31889:59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
This results in a significant decrease in syscall overhead
giving a 3% speedup to the digest utilities for example
(when processing large files from cache).
Storage is moved from the stack to the heap as some
threaded environments for example can have small stacks.
* lib/copy-file.c (copy_file_preserving): Use a 32KiB malloced buffer
* modules/copy-file: Depend on xalloc
* lib/md2.c: Likewise
* lib/md4.c: Likewise
* lib/md5.c: Likewise
* lib/sha1.c: Likewise
* lib/sha256.c: Likewise
* lib/sha512.c: Likewise
author | Pádraig Brady <P@draigBrady.com> |
---|---|
date | Thu, 22 Oct 2009 17:36:28 +0100 |
parents | 6852b588fd27 |
children | e8d2c6fc33ad |
rev | line source |
---|---|
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
1 /* sha1.c - Functions to compute SHA1 message digest of files or |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
2 memory blocks according to the NIST specification FIPS-180-1. |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
3 |
29351
e422e11f6cf7
sha1.c (set_uint32): Mark function as static.
Simon Josefsson <simon@josefsson.org>
parents:
29347
diff
changeset
|
4 Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2008 Free Software |
26244 | 5 Foundation, Inc. |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
6 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
7 This program is free software; you can redistribute it and/or modify it |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
9 Free Software Foundation; either version 2, or (at your option) any |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
10 later version. |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
11 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
12 This program is distributed in the hope that it will be useful, |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
15 GNU General Public License for more details. |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
16 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
18 along with this program; if not, write to the Free Software Foundation, |
25539
31d0a0378f7e
*** empty log message ***
Paul Eggert <eggert@cs.ucla.edu>
parents:
25009
diff
changeset
|
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
20 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
21 /* Written by Scott G. Miller |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
22 Credits: |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
23 Robert Klep <robert@ilse.nl> -- Expansion function fix |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
24 */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
25 |
26993
8aa31e5d3ec4
* _fpending.c: Include <config.h> unconditionally, since we no
Paul Eggert <eggert@cs.ucla.edu>
parents:
26478
diff
changeset
|
26 #include <config.h> |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
27 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
28 #include "sha1.h" |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
29 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
30 #include <stddef.h> |
31889
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
31 #include <stdlib.h> |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
32 #include <string.h> |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
33 |
25009
ea3c229c77ea
Remove dependencies on unlocked-io.
Paul Eggert <eggert@cs.ucla.edu>
parents:
24856
diff
changeset
|
34 #if USE_UNLOCKED_IO |
ea3c229c77ea
Remove dependencies on unlocked-io.
Paul Eggert <eggert@cs.ucla.edu>
parents:
24856
diff
changeset
|
35 # include "unlocked-io.h" |
ea3c229c77ea
Remove dependencies on unlocked-io.
Paul Eggert <eggert@cs.ucla.edu>
parents:
24856
diff
changeset
|
36 #endif |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
37 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
38 #ifdef WORDS_BIGENDIAN |
25913
299e806d4eb9
Merge glibc and coreutils changes into gnulib, plus a few
Paul Eggert <eggert@cs.ucla.edu>
parents:
25539
diff
changeset
|
39 # define SWAP(n) (n) |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
40 #else |
25913
299e806d4eb9
Merge glibc and coreutils changes into gnulib, plus a few
Paul Eggert <eggert@cs.ucla.edu>
parents:
25539
diff
changeset
|
41 # define SWAP(n) \ |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
42 (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
43 #endif |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
44 |
31889
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
45 #define BLOCKSIZE 32768 |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
46 #if BLOCKSIZE % 64 != 0 |
25913
299e806d4eb9
Merge glibc and coreutils changes into gnulib, plus a few
Paul Eggert <eggert@cs.ucla.edu>
parents:
25539
diff
changeset
|
47 # error "invalid BLOCKSIZE" |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
48 #endif |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
49 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
50 /* This array contains the bytes used to pad the buffer to the next |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
51 64-byte boundary. (RFC 1321, 3.1: Step 1) */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
52 static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
53 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
54 |
26244 | 55 /* Take a pointer to a 160 bit block of data (five 32 bit ints) and |
56 initialize it to the start constants of the SHA1 algorithm. This | |
57 must be called before using hash in the call to sha1_hash. */ | |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
58 void |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
59 sha1_init_ctx (struct sha1_ctx *ctx) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
60 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
61 ctx->A = 0x67452301; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
62 ctx->B = 0xefcdab89; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
63 ctx->C = 0x98badcfe; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
64 ctx->D = 0x10325476; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
65 ctx->E = 0xc3d2e1f0; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
66 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
67 ctx->total[0] = ctx->total[1] = 0; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
68 ctx->buflen = 0; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
69 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
70 |
29347
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
71 /* Copy the 4 byte value from v into the memory location pointed to by *cp, |
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
72 If your architecture allows unaligned access this is equivalent to |
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
73 * (uint32_t *) cp = v */ |
29358
c7eaae3c0d1a
Mark set_uint32 function as 'inline'.
Bruno Haible <bruno@clisp.org>
parents:
29357
diff
changeset
|
74 static inline void |
29347
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
75 set_uint32 (char *cp, uint32_t v) |
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
76 { |
29353
f9475e9874b4
Prefer "sizeof v" over the equivalent "4".
Jim Meyering <meyering@redhat.com>
parents:
29351
diff
changeset
|
77 memcpy (cp, &v, sizeof v); |
29347
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
78 } |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
79 |
29347
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
80 /* Put result from CTX in first 20 bytes following RESBUF. The result |
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
81 must be in little endian byte order. */ |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
82 void * |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
83 sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
84 { |
29347
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
85 char *r = resbuf; |
29357
e7c097072524
Use "sizeof VAR", rather than a literal "4".
Jim Meyering <meyering@redhat.com>
parents:
29353
diff
changeset
|
86 set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A)); |
e7c097072524
Use "sizeof VAR", rather than a literal "4".
Jim Meyering <meyering@redhat.com>
parents:
29353
diff
changeset
|
87 set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B)); |
e7c097072524
Use "sizeof VAR", rather than a literal "4".
Jim Meyering <meyering@redhat.com>
parents:
29353
diff
changeset
|
88 set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C)); |
e7c097072524
Use "sizeof VAR", rather than a literal "4".
Jim Meyering <meyering@redhat.com>
parents:
29353
diff
changeset
|
89 set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D)); |
e7c097072524
Use "sizeof VAR", rather than a literal "4".
Jim Meyering <meyering@redhat.com>
parents:
29353
diff
changeset
|
90 set_uint32 (r + 4 * sizeof ctx->E, SWAP (ctx->E)); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
91 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
92 return resbuf; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
93 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
94 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
95 /* Process the remaining bytes in the internal buffer and the usual |
29347
49c64d003ba6
sha1: remove the result buffer alignment constraint
Peter Palfrader <weasel@debian.org>
parents:
26993
diff
changeset
|
96 prolog according to the standard and write the result to RESBUF. */ |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
97 void * |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
98 sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
99 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
100 /* Take yet unprocessed bytes into account. */ |
26072
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
101 uint32_t bytes = ctx->buflen; |
26244 | 102 size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4; |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
103 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
104 /* Now count remaining bytes. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
105 ctx->total[0] += bytes; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
106 if (ctx->total[0] < bytes) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
107 ++ctx->total[1]; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
108 |
26244 | 109 /* Put the 64-bit file length in *bits* at the end of the buffer. */ |
110 ctx->buffer[size - 2] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); | |
111 ctx->buffer[size - 1] = SWAP (ctx->total[0] << 3); | |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
112 |
26244 | 113 memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
114 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
115 /* Process last bytes. */ |
26244 | 116 sha1_process_block (ctx->buffer, size * 4, ctx); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
117 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
118 return sha1_read_ctx (ctx, resbuf); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
119 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
120 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
121 /* Compute SHA1 message digest for bytes read from STREAM. The |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
122 resulting message digest number will be written into the 16 bytes |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
123 beginning at RESBLOCK. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
124 int |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
125 sha1_stream (FILE *stream, void *resblock) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
126 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
127 struct sha1_ctx ctx; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
128 size_t sum; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
129 |
31889
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
130 char *buffer = malloc (BLOCKSIZE + 72); |
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
131 if (!buffer) |
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
132 return 1; |
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
133 |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
134 /* Initialize the computation context. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
135 sha1_init_ctx (&ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
136 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
137 /* Iterate over full file contents. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
138 while (1) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
139 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
140 /* We read the file in blocks of BLOCKSIZE bytes. One call of the |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
141 computation function processes the whole buffer so that with the |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
142 next round of the loop another block can be read. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
143 size_t n; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
144 sum = 0; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
145 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
146 /* Read block. Take care for partial reads. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
147 while (1) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
148 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
149 n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
150 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
151 sum += n; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
152 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
153 if (sum == BLOCKSIZE) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
154 break; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
155 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
156 if (n == 0) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
157 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
158 /* Check for the error flag IFF N == 0, so that we don't |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
159 exit the loop after a partial read due to e.g., EAGAIN |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
160 or EWOULDBLOCK. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
161 if (ferror (stream)) |
31889
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
162 { |
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
163 free (buffer); |
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
164 return 1; |
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
165 } |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
166 goto process_partial_block; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
167 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
168 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
169 /* We've read at least one byte, so ignore errors. But always |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
170 check for EOF, since feof may be true even though N > 0. |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
171 Otherwise, we could end up calling fread after EOF. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
172 if (feof (stream)) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
173 goto process_partial_block; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
174 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
175 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
176 /* Process buffer with BLOCKSIZE bytes. Note that |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
177 BLOCKSIZE % 64 == 0 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
178 */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
179 sha1_process_block (buffer, BLOCKSIZE, &ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
180 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
181 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
182 process_partial_block:; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
183 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
184 /* Process any remaining bytes. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
185 if (sum > 0) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
186 sha1_process_bytes (buffer, sum, &ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
187 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
188 /* Construct result in desired memory. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
189 sha1_finish_ctx (&ctx, resblock); |
31889
59a9e6ad38f8
digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
Pádraig Brady <P@draigBrady.com>
parents:
29487
diff
changeset
|
190 free (buffer); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
191 return 0; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
192 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
193 |
26478
e0a5d2c96f89
sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
Jim Meyering <jim@meyering.net>
parents:
26475
diff
changeset
|
194 /* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
195 result is always in little endian byte order, so that a byte-wise |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
196 output yields to the wanted ASCII representation of the message |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
197 digest. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
198 void * |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
199 sha1_buffer (const char *buffer, size_t len, void *resblock) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
200 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
201 struct sha1_ctx ctx; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
202 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
203 /* Initialize the computation context. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
204 sha1_init_ctx (&ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
205 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
206 /* Process whole buffer but last len % 64 bytes. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
207 sha1_process_bytes (buffer, len, &ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
208 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
209 /* Put result in desired memory area. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
210 return sha1_finish_ctx (&ctx, resblock); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
211 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
212 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
213 void |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
214 sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
215 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
216 /* When we already have some bits in our internal buffer concatenate |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
217 both inputs first. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
218 if (ctx->buflen != 0) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
219 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
220 size_t left_over = ctx->buflen; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
221 size_t add = 128 - left_over > len ? len : 128 - left_over; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
222 |
26244 | 223 memcpy (&((char *) ctx->buffer)[left_over], buffer, add); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
224 ctx->buflen += add; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
225 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
226 if (ctx->buflen > 64) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
227 { |
29487 | 228 sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx); |
229 | |
29486
fffcd768cb9c
sha1.c, md5.c: Hoist a redundant expression.
Jim Meyering <meyering@redhat.com>
parents:
29358
diff
changeset
|
230 ctx->buflen &= 63; |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
231 /* The regions in the following copy operation cannot overlap. */ |
26244 | 232 memcpy (ctx->buffer, |
233 &((char *) ctx->buffer)[(left_over + add) & ~63], | |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
234 ctx->buflen); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
235 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
236 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
237 buffer = (const char *) buffer + add; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
238 len -= add; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
239 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
240 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
241 /* Process available complete blocks. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
242 if (len >= 64) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
243 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
244 #if !_STRING_ARCH_unaligned |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
245 # define alignof(type) offsetof (struct { char c; type x; }, x) |
26072
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
246 # define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0) |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
247 if (UNALIGNED_P (buffer)) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
248 while (len > 64) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
249 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
250 sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
251 buffer = (const char *) buffer + 64; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
252 len -= 64; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
253 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
254 else |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
255 #endif |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
256 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
257 sha1_process_block (buffer, len & ~63, ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
258 buffer = (const char *) buffer + (len & ~63); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
259 len &= 63; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
260 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
261 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
262 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
263 /* Move remaining bytes in internal buffer. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
264 if (len > 0) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
265 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
266 size_t left_over = ctx->buflen; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
267 |
26244 | 268 memcpy (&((char *) ctx->buffer)[left_over], buffer, len); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
269 left_over += len; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
270 if (left_over >= 64) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
271 { |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
272 sha1_process_block (ctx->buffer, 64, ctx); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
273 left_over -= 64; |
26244 | 274 memcpy (ctx->buffer, &ctx->buffer[16], left_over); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
275 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
276 ctx->buflen = left_over; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
277 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
278 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
279 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
280 /* --- Code below is the primary difference between md5.c and sha1.c --- */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
281 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
282 /* SHA1 round constants */ |
26475
61306c7a6237
2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
Simon Josefsson <simon@josefsson.org>
parents:
26244
diff
changeset
|
283 #define K1 0x5a827999 |
61306c7a6237
2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
Simon Josefsson <simon@josefsson.org>
parents:
26244
diff
changeset
|
284 #define K2 0x6ed9eba1 |
61306c7a6237
2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
Simon Josefsson <simon@josefsson.org>
parents:
26244
diff
changeset
|
285 #define K3 0x8f1bbcdc |
61306c7a6237
2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
Simon Josefsson <simon@josefsson.org>
parents:
26244
diff
changeset
|
286 #define K4 0xca62c1d6 |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
287 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
288 /* Round functions. Note that F2 is the same as F4. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
289 #define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) ) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
290 #define F2(B,C,D) (B ^ C ^ D) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
291 #define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) ) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
292 #define F4(B,C,D) (B ^ C ^ D) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
293 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
294 /* Process LEN bytes of BUFFER, accumulating context into CTX. |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
295 It is assumed that LEN % 64 == 0. |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
296 Most of this code comes from GnuPG's cipher/sha1.c. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
297 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
298 void |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
299 sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
300 { |
26072
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
301 const uint32_t *words = buffer; |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
302 size_t nwords = len / sizeof (uint32_t); |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
303 const uint32_t *endp = words + nwords; |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
304 uint32_t x[16]; |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
305 uint32_t a = ctx->A; |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
306 uint32_t b = ctx->B; |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
307 uint32_t c = ctx->C; |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
308 uint32_t d = ctx->D; |
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
309 uint32_t e = ctx->E; |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
310 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
311 /* First increment the byte count. RFC 1321 specifies the possible |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
312 length of the file up to 2^64 bits. Here we only compute the |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
313 number of bytes. Do a double word increment. */ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
314 ctx->total[0] += len; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
315 if (ctx->total[0] < len) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
316 ++ctx->total[1]; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
317 |
26475
61306c7a6237
2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
Simon Josefsson <simon@josefsson.org>
parents:
26244
diff
changeset
|
318 #define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n)))) |
25913
299e806d4eb9
Merge glibc and coreutils changes into gnulib, plus a few
Paul Eggert <eggert@cs.ucla.edu>
parents:
25539
diff
changeset
|
319 |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
320 #define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
321 ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
322 , (x[I&0x0f] = rol(tm, 1)) ) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
323 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
324 #define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
325 + F( B, C, D ) \ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
326 + K \ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
327 + M; \ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
328 B = rol( B, 30 ); \ |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
329 } while(0) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
330 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
331 while (words < endp) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
332 { |
26072
56e6483a97ab
Separate sha1 from md5. Use stdint.h in both modules.
Simon Josefsson <simon@josefsson.org>
parents:
25913
diff
changeset
|
333 uint32_t tm; |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
334 int t; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
335 for (t = 0; t < 16; t++) |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
336 { |
25913
299e806d4eb9
Merge glibc and coreutils changes into gnulib, plus a few
Paul Eggert <eggert@cs.ucla.edu>
parents:
25539
diff
changeset
|
337 x[t] = SWAP (*words); |
24856
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
338 words++; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
339 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
340 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
341 R( a, b, c, d, e, F1, K1, x[ 0] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
342 R( e, a, b, c, d, F1, K1, x[ 1] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
343 R( d, e, a, b, c, F1, K1, x[ 2] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
344 R( c, d, e, a, b, F1, K1, x[ 3] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
345 R( b, c, d, e, a, F1, K1, x[ 4] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
346 R( a, b, c, d, e, F1, K1, x[ 5] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
347 R( e, a, b, c, d, F1, K1, x[ 6] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
348 R( d, e, a, b, c, F1, K1, x[ 7] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
349 R( c, d, e, a, b, F1, K1, x[ 8] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
350 R( b, c, d, e, a, F1, K1, x[ 9] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
351 R( a, b, c, d, e, F1, K1, x[10] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
352 R( e, a, b, c, d, F1, K1, x[11] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
353 R( d, e, a, b, c, F1, K1, x[12] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
354 R( c, d, e, a, b, F1, K1, x[13] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
355 R( b, c, d, e, a, F1, K1, x[14] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
356 R( a, b, c, d, e, F1, K1, x[15] ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
357 R( e, a, b, c, d, F1, K1, M(16) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
358 R( d, e, a, b, c, F1, K1, M(17) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
359 R( c, d, e, a, b, F1, K1, M(18) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
360 R( b, c, d, e, a, F1, K1, M(19) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
361 R( a, b, c, d, e, F2, K2, M(20) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
362 R( e, a, b, c, d, F2, K2, M(21) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
363 R( d, e, a, b, c, F2, K2, M(22) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
364 R( c, d, e, a, b, F2, K2, M(23) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
365 R( b, c, d, e, a, F2, K2, M(24) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
366 R( a, b, c, d, e, F2, K2, M(25) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
367 R( e, a, b, c, d, F2, K2, M(26) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
368 R( d, e, a, b, c, F2, K2, M(27) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
369 R( c, d, e, a, b, F2, K2, M(28) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
370 R( b, c, d, e, a, F2, K2, M(29) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
371 R( a, b, c, d, e, F2, K2, M(30) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
372 R( e, a, b, c, d, F2, K2, M(31) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
373 R( d, e, a, b, c, F2, K2, M(32) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
374 R( c, d, e, a, b, F2, K2, M(33) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
375 R( b, c, d, e, a, F2, K2, M(34) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
376 R( a, b, c, d, e, F2, K2, M(35) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
377 R( e, a, b, c, d, F2, K2, M(36) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
378 R( d, e, a, b, c, F2, K2, M(37) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
379 R( c, d, e, a, b, F2, K2, M(38) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
380 R( b, c, d, e, a, F2, K2, M(39) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
381 R( a, b, c, d, e, F3, K3, M(40) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
382 R( e, a, b, c, d, F3, K3, M(41) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
383 R( d, e, a, b, c, F3, K3, M(42) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
384 R( c, d, e, a, b, F3, K3, M(43) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
385 R( b, c, d, e, a, F3, K3, M(44) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
386 R( a, b, c, d, e, F3, K3, M(45) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
387 R( e, a, b, c, d, F3, K3, M(46) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
388 R( d, e, a, b, c, F3, K3, M(47) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
389 R( c, d, e, a, b, F3, K3, M(48) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
390 R( b, c, d, e, a, F3, K3, M(49) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
391 R( a, b, c, d, e, F3, K3, M(50) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
392 R( e, a, b, c, d, F3, K3, M(51) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
393 R( d, e, a, b, c, F3, K3, M(52) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
394 R( c, d, e, a, b, F3, K3, M(53) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
395 R( b, c, d, e, a, F3, K3, M(54) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
396 R( a, b, c, d, e, F3, K3, M(55) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
397 R( e, a, b, c, d, F3, K3, M(56) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
398 R( d, e, a, b, c, F3, K3, M(57) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
399 R( c, d, e, a, b, F3, K3, M(58) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
400 R( b, c, d, e, a, F3, K3, M(59) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
401 R( a, b, c, d, e, F4, K4, M(60) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
402 R( e, a, b, c, d, F4, K4, M(61) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
403 R( d, e, a, b, c, F4, K4, M(62) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
404 R( c, d, e, a, b, F4, K4, M(63) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
405 R( b, c, d, e, a, F4, K4, M(64) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
406 R( a, b, c, d, e, F4, K4, M(65) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
407 R( e, a, b, c, d, F4, K4, M(66) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
408 R( d, e, a, b, c, F4, K4, M(67) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
409 R( c, d, e, a, b, F4, K4, M(68) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
410 R( b, c, d, e, a, F4, K4, M(69) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
411 R( a, b, c, d, e, F4, K4, M(70) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
412 R( e, a, b, c, d, F4, K4, M(71) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
413 R( d, e, a, b, c, F4, K4, M(72) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
414 R( c, d, e, a, b, F4, K4, M(73) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
415 R( b, c, d, e, a, F4, K4, M(74) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
416 R( a, b, c, d, e, F4, K4, M(75) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
417 R( e, a, b, c, d, F4, K4, M(76) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
418 R( d, e, a, b, c, F4, K4, M(77) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
419 R( c, d, e, a, b, F4, K4, M(78) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
420 R( b, c, d, e, a, F4, K4, M(79) ); |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
421 |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
422 a = ctx->A += a; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
423 b = ctx->B += b; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
424 c = ctx->C += c; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
425 d = ctx->D += d; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
426 e = ctx->E += e; |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
427 } |
d1bd730b77d7
Add uint32_t.m4, uintptr_t.m4, and finish renaming sha->sha1.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff
changeset
|
428 } |