1145519Sdarrenr/* MD5.H - header file for MD5C.C
2145510Sdarrenr * $FreeBSD$
322514Sdarrenr */
4255332Scy
522514Sdarrenr/*-
680486Sdarrenr Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
722514Sdarrenrrights reserved.
822514Sdarrenr
926119SdarrenrLicense to copy and use this software is granted provided that it
1026119Sdarrenris identified as the "RSA Data Security, Inc. MD5 Message-Digest
1126119SdarrenrAlgorithm" in all material mentioning or referencing this software
1222514Sdarrenror this function.
1322514Sdarrenr
14255332ScyLicense is also granted to make and use derivative works provided
1522514Sdarrenrthat such works are identified as "derived from the RSA Data
1622514SdarrenrSecurity, Inc. MD5 Message-Digest Algorithm" in all material
1722514Sdarrenrmentioning or referencing the derived work.
1822514Sdarrenr
1922514SdarrenrRSA Data Security, Inc. makes no representations concerning either
2022514Sdarrenrthe merchantability of this software or the suitability of this
2122514Sdarrenrsoftware for any particular purpose. It is provided "as is"
2222514Sdarrenrwithout express or implied warranty of any kind.
2322514Sdarrenr
2422514SdarrenrThese notices must be retained in any copies of any part of this
2522514Sdarrenrdocumentation and/or software.
2622514Sdarrenr */
2722514Sdarrenr
2822514Sdarrenr#ifndef _SYS_MD5_H_
2922514Sdarrenr#define _SYS_MD5_H_
3022514Sdarrenr
3122514Sdarrenr#define MD5_BLOCK_LENGTH		64
3222514Sdarrenr#define MD5_DIGEST_LENGTH		16
3322514Sdarrenr#define MD5_DIGEST_STRING_LENGTH	(MD5_DIGEST_LENGTH * 2 + 1)
3422514Sdarrenr
3522514Sdarrenr/* MD5 context. */
3622514Sdarrenrtypedef struct MD5Context {
3722514Sdarrenr  u_int32_t state[4];	/* state (ABCD) */
3822514Sdarrenr  u_int32_t count[2];	/* number of bits, modulo 2^64 (lsb first) */
3922514Sdarrenr  unsigned char buffer[64];	/* input buffer */
4022514Sdarrenr} MD5_CTX;
4122514Sdarrenr
4222514Sdarrenr#include <sys/cdefs.h>
4322514Sdarrenr
4422514Sdarrenr__BEGIN_DECLS
4522514Sdarrenrvoid   MD5Init (MD5_CTX *);
4626119Sdarrenrvoid   MD5Update (MD5_CTX *, const void *, unsigned int);
4726119Sdarrenrvoid   MD5Final (unsigned char [16], MD5_CTX *);
48char * MD5End(MD5_CTX *, char *);
49char * MD5File(const char *, char *);
50char * MD5FileChunk(const char *, char *, off_t, off_t);
51char * MD5Data(const void *, unsigned int, char *);
52__END_DECLS
53#endif /* _SYS_MD5_H_ */
54