1 /* MD5.H - header file for MD5C.C
2 * $FreeBSD: src/sys/sys/md5.h,v 1.20 2006/03/15 19:47:12 andre Exp $
3 * $DragonFly: src/sys/sys/md5.h,v 1.5 2008/09/11 20:25:34 swildner Exp $
7 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
10 License to copy and use this software is granted provided that it
11 is identified as the "RSA Data Security, Inc. MD5 Message-Digest
12 Algorithm" in all material mentioning or referencing this software
15 License is also granted to make and use derivative works provided
16 that such works are identified as "derived from the RSA Data
17 Security, Inc. MD5 Message-Digest Algorithm" in all material
18 mentioning or referencing the derived work.
20 RSA Data Security, Inc. makes no representations concerning either
21 the merchantability of this software or the suitability of this
22 software for any particular purpose. It is provided "as is"
23 without express or implied warranty of any kind.
25 These notices must be retained in any copies of any part of this
26 documentation and/or software.
33 #include <sys/types.h>
36 #define MD5_BLOCK_LENGTH 64
37 #define MD5_DIGEST_LENGTH 16
38 #define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1)
41 typedef struct MD5Context {
42 u_int32_t state[4]; /* state (ABCD) */
43 u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
44 unsigned char buffer[64]; /* input buffer */
47 #include <sys/cdefs.h>
50 void MD5Init (MD5_CTX *);
51 void MD5Update (MD5_CTX *, const void *, unsigned int);
52 void MD5Pad (MD5_CTX *);
53 void MD5Final (unsigned char [16], MD5_CTX *);
54 char * MD5End(MD5_CTX *, char *);
55 char * MD5File(const char *, char *);
56 char * MD5FileChunk(const char *, char *, off_t, off_t);
57 char * MD5Data(const void *, unsigned int, char *);
59 void MD5Transform (u_int32_t [4], const unsigned char [64]);
63 #endif /* _SYS_MD5_H_ */