Mercurial > hg > octave-kai > gnulib-hg
annotate lib/md4.h @ 17249:e542fd46ad6f
maint: update all copyright year number ranges
Run "make update-copyright". Compare to commit 1602f0a from last year.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Tue, 01 Jan 2013 00:50:58 +0000 |
parents | bb182ee4a09d |
children |
rev | line source |
---|---|
6393 | 1 /* Declarations of functions and data types used for MD4 sum |
2 library functions. | |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16366
diff
changeset
|
3 Copyright (C) 2000-2001, 2003, 2005, 2008-2013 Free Software Foundation, |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
4 Inc. |
6393 | 5 |
6 This program is free software; you can redistribute it and/or modify it | |
7 under the terms of the GNU General Public License as published by the | |
8 Free Software Foundation; either version 2, or (at your option) any | |
9 later version. | |
10 | |
11 This program is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
16366
bb182ee4a09d
maint: replace FSF snail-mail addresses with URLs
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
17 along with this program; if not, see <http://www.gnu.org/licenses/>. */ |
6393 | 18 |
19 #ifndef MD4_H | |
20 # define MD4_H 1 | |
21 | |
22 # include <stdio.h> | |
23 # include <stdint.h> | |
24 | |
11731
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
25 # ifdef __cplusplus |
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
26 extern "C" { |
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
27 # endif |
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
28 |
6422
833177ba48f0
* md4.c, md4.c: Simplify buffer handling visavi alignment,
Simon Josefsson <simon@josefsson.org>
parents:
6393
diff
changeset
|
29 # define MD4_DIGEST_SIZE 16 |
6393 | 30 |
31 /* Structure to save state of computation between the single steps. */ | |
32 struct md4_ctx | |
33 { | |
34 uint32_t A; | |
35 uint32_t B; | |
36 uint32_t C; | |
37 uint32_t D; | |
38 | |
39 uint32_t total[2]; | |
40 uint32_t buflen; | |
6428
7f3d97f1f72d
* md4.h: Shrink buffer size, now that we changed the type.
Simon Josefsson <simon@josefsson.org>
parents:
6422
diff
changeset
|
41 uint32_t buffer[32]; |
6393 | 42 }; |
43 | |
44 | |
45 /* Initialize structure containing state of computation. */ | |
46 extern void md4_init_ctx (struct md4_ctx *ctx); | |
47 | |
48 /* Starting with the result of former calls of this function (or the | |
49 initialization function update the context for the next LEN bytes | |
50 starting at BUFFER. | |
51 It is necessary that LEN is a multiple of 64!!! */ | |
52 extern void md4_process_block (const void *buffer, size_t len, | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11749
diff
changeset
|
53 struct md4_ctx *ctx); |
6393 | 54 |
55 /* Starting with the result of former calls of this function (or the | |
56 initialization function update the context for the next LEN bytes | |
57 starting at BUFFER. | |
58 It is NOT required that LEN is a multiple of 64. */ | |
59 extern void md4_process_bytes (const void *buffer, size_t len, | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11749
diff
changeset
|
60 struct md4_ctx *ctx); |
6393 | 61 |
62 /* Process the remaining bytes in the buffer and put result from CTX | |
63 in first 16 bytes following RESBUF. The result is always in little | |
64 endian byte order, so that a byte-wise output yields to the wanted | |
9658
b704008db267
md4: adapt alignment constraint fix from sha1.
Simon Josefsson <simon@josefsson.org>
parents:
6428
diff
changeset
|
65 ASCII representation of the message digest. */ |
6393 | 66 extern void *md4_finish_ctx (struct md4_ctx *ctx, void *resbuf); |
67 | |
68 | |
69 /* Put result from CTX in first 16 bytes following RESBUF. The result is | |
70 always in little endian byte order, so that a byte-wise output yields | |
9658
b704008db267
md4: adapt alignment constraint fix from sha1.
Simon Josefsson <simon@josefsson.org>
parents:
6428
diff
changeset
|
71 to the wanted ASCII representation of the message digest. */ |
6393 | 72 extern void *md4_read_ctx (const struct md4_ctx *ctx, void *resbuf); |
73 | |
74 | |
75 /* Compute MD4 message digest for bytes read from STREAM. The | |
76 resulting message digest number will be written into the 16 bytes | |
77 beginning at RESBLOCK. */ | |
78 extern int md4_stream (FILE * stream, void *resblock); | |
79 | |
80 /* Compute MD4 message digest for LEN bytes beginning at BUFFER. The | |
81 result is always in little endian byte order, so that a byte-wise | |
82 output yields to the wanted ASCII representation of the message | |
83 digest. */ | |
84 extern void *md4_buffer (const char *buffer, size_t len, void *resblock); | |
85 | |
11731
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
86 # ifdef __cplusplus |
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
87 } |
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
88 # endif |
2ddd55967fe9
C++: wrap md2,md5,sha1,etc. function declarations in extern "C" scope
Peter Simons <simons@cryp.to>
parents:
9658
diff
changeset
|
89 |
6393 | 90 #endif |