1 /* Declarations of functions and data types used for MD4 sum
3 Copyright (C) 2000-2001, 2003, 2005, 2008-2011 Free Software Foundation,
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
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.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
30 # define MD4_DIGEST_SIZE 16
32 /* Structure to save state of computation between the single steps. */
46 /* Initialize structure containing state of computation. */
47 extern void md4_init_ctx (struct md4_ctx *ctx);
49 /* Starting with the result of former calls of this function (or the
50 initialization function update the context for the next LEN bytes
52 It is necessary that LEN is a multiple of 64!!! */
53 extern void md4_process_block (const void *buffer, size_t len,
56 /* Starting with the result of former calls of this function (or the
57 initialization function update the context for the next LEN bytes
59 It is NOT required that LEN is a multiple of 64. */
60 extern void md4_process_bytes (const void *buffer, size_t len,
63 /* Process the remaining bytes in the buffer and put result from CTX
64 in first 16 bytes following RESBUF. The result is always in little
65 endian byte order, so that a byte-wise output yields to the wanted
66 ASCII representation of the message digest. */
67 extern void *md4_finish_ctx (struct md4_ctx *ctx, void *resbuf);
70 /* Put result from CTX in first 16 bytes following RESBUF. The result is
71 always in little endian byte order, so that a byte-wise output yields
72 to the wanted ASCII representation of the message digest. */
73 extern void *md4_read_ctx (const struct md4_ctx *ctx, void *resbuf);
76 /* Compute MD4 message digest for bytes read from STREAM. The
77 resulting message digest number will be written into the 16 bytes
78 beginning at RESBLOCK. */
79 extern int md4_stream (FILE * stream, void *resblock);
81 /* Compute MD4 message digest for LEN bytes beginning at BUFFER. The
82 result is always in little endian byte order, so that a byte-wise
83 output yields to the wanted ASCII representation of the message
85 extern void *md4_buffer (const char *buffer, size_t len, void *resblock);