Annotation of src/include/md4.h, Revision 1.14
1.14 ! millert 1: /* $OpenBSD: md4.h,v 1.13 2004/04/29 15:51:16 millert Exp $ */
1.1 niklas 2:
1.12 millert 3: /*
4: * This code implements the MD4 message-digest algorithm.
5: * The algorithm is due to Ron Rivest. This code was
6: * written by Colin Plumb in 1993, no copyright is claimed.
7: * This code is in the public domain; do with it what you wish.
8: * Todd C. Miller modified the MD5 code to do MD4 based on RFC 1186.
9: *
10: * Equivalent code is available from RSA Data Security, Inc.
11: * This code has been tested against that, and is equivalent,
12: * except that you don't need to include two pages of legalese
13: * with every copy.
1.1 niklas 14: */
15:
16: #ifndef _MD4_H_
17: #define _MD4_H_
1.3 millert 18:
1.12 millert 19: #define MD4_BLOCK_LENGTH 64
20: #define MD4_DIGEST_LENGTH 16
21: #define MD4_DIGEST_STRING_LENGTH (MD4_DIGEST_LENGTH * 2 + 1)
22:
1.1 niklas 23: typedef struct MD4Context {
1.12 millert 24: u_int32_t state[4]; /* state */
25: u_int64_t count; /* number of bits, mod 2^64 */
26: u_int8_t buffer[MD4_BLOCK_LENGTH]; /* input buffer */
1.1 niklas 27: } MD4_CTX;
28:
1.7 millert 29: #include <sys/cdefs.h>
30:
31: __BEGIN_DECLS
1.12 millert 32: void MD4Init(MD4_CTX *);
33: void MD4Update(MD4_CTX *, const u_int8_t *, size_t)
1.11 avsm 34: __attribute__((__bounded__(__string__,2,3)));
1.14 ! millert 35: void MD4Pad(MD4_CTX *);
1.12 millert 36: void MD4Final(u_int8_t [MD4_DIGEST_LENGTH], MD4_CTX *)
37: __attribute__((__bounded__(__minbytes__,1,MD4_DIGEST_LENGTH)));
38: void MD4Transform(u_int32_t [4], const u_int8_t [MD4_BLOCK_LENGTH])
1.11 avsm 39: __attribute__((__bounded__(__minbytes__,1,4)))
1.12 millert 40: __attribute__((__bounded__(__minbytes__,2,MD4_BLOCK_LENGTH)));
1.13 millert 41: char *MD4End(MD4_CTX *, char *)
1.12 millert 42: __attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
1.13 millert 43: char *MD4File(char *, char *)
1.14 ! millert 44: __attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
! 45: char *MD4FileChunk(char *, char *, off_t, off_t)
1.12 millert 46: __attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
1.13 millert 47: char *MD4Data(const u_int8_t *, size_t, char *)
1.11 avsm 48: __attribute__((__bounded__(__string__,1,2)))
1.12 millert 49: __attribute__((__bounded__(__minbytes__,3,MD4_DIGEST_STRING_LENGTH)));
1.7 millert 50: __END_DECLS
1.1 niklas 51:
52: #endif /* _MD4_H_ */