1 #ifndef	md5_h
2 #define	md5_h
3 
4 /*
5 ** Copyright 1998 - 2001 Double Precision, Inc.
6 ** See COPYING for distribution information.
7 */
8 
9 /*
10 ** RFC 1321 MD5 Message digest calculation.
11 **
12 ** Returns a pointer to a sixteen-byte message digest.
13 */
14 
15 #ifdef	__cplusplus
16 extern "C" {
17 #endif
18 
19 #if	HAVE_CONFIG_H
20 #include	"md5/config.h"
21 #endif
22 
23 #if	HAVE_SYS_TYPES_H
24 #include	<sys/types.h>
25 #endif
26 
27 #if	HAVE_STDINT_H
28 #include	<stdint.h>
29 #endif
30 #define	MD5_DIGEST_SIZE	16
31 #define	MD5_BLOCK_SIZE	64
32 
33 typedef unsigned char MD5_DIGEST[MD5_DIGEST_SIZE];
34 
35 #ifdef	MD5_INTERNAL
36 
37 struct MD5_CONTEXT {
38 
39 	MD5_WORD	A, B, C, D;
40 
41 	unsigned char blk[MD5_BLOCK_SIZE];
42 	unsigned blk_ptr;
43 	} ;
44 
45 void md5_context_init(struct MD5_CONTEXT *);
46 void md5_context_hash(struct MD5_CONTEXT *,
47 		const unsigned char[MD5_BLOCK_SIZE]);
48 void md5_context_hashstream(struct MD5_CONTEXT *, const void *, unsigned);
49 void md5_context_endstream(struct MD5_CONTEXT *, unsigned long);
50 void md5_context_digest(struct MD5_CONTEXT *, MD5_DIGEST);
51 
52 void md5_context_restore(struct MD5_CONTEXT *, const MD5_DIGEST);
53 
54 #endif
55 
56 void md5_digest(const void *msg, unsigned int len, MD5_DIGEST);
57 
58 char *md5_crypt_redhat(const char *, const char *);
59 #define	md5_crypt	md5_crypt_redhat
60 
61 const char *md5_hash_courier(const char *);
62 const char *md5_hash_raw(const char *);
63 
64 #ifdef	__cplusplus
65 } ;
66 #endif
67 
68 #endif
69