Annotation of src/include/md4.h, Revision 1.12
1.12 ! millert 1: /* $OpenBSD: md4.h,v 1.11 2003/10/07 22:17:27 avsm 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.12 ! millert 35: void MD4Final(u_int8_t [MD4_DIGEST_LENGTH], MD4_CTX *)
! 36: __attribute__((__bounded__(__minbytes__,1,MD4_DIGEST_LENGTH)));
! 37: void MD4Transform(u_int32_t [4], const u_int8_t [MD4_BLOCK_LENGTH])
1.11 avsm 38: __attribute__((__bounded__(__minbytes__,1,4)))
1.12 ! millert 39: __attribute__((__bounded__(__minbytes__,2,MD4_BLOCK_LENGTH)));
! 40: char *MD4End(MD4_CTX *, char [MD4_DIGEST_STRING_LENGTH])
! 41: __attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
! 42: char *MD4File(char *, char [MD4_DIGEST_STRING_LENGTH])
! 43: __attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
! 44: char *MD4Data(const u_int8_t *, size_t, char [MD4_DIGEST_STRING_LENGTH])
1.11 avsm 45: __attribute__((__bounded__(__string__,1,2)))
1.12 ! millert 46: __attribute__((__bounded__(__minbytes__,3,MD4_DIGEST_STRING_LENGTH)));
1.7 millert 47: __END_DECLS
1.1 niklas 48:
49: #endif /* _MD4_H_ */