d9898ee8 |
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 | #define MD5_DIGEST_SIZE 16 |
28 | #define MD5_BLOCK_SIZE 64 |
29 | |
30 | typedef unsigned char MD5_DIGEST[MD5_DIGEST_SIZE]; |
31 | |
32 | #ifdef MD5_INTERNAL |
33 | |
34 | struct MD5_CONTEXT { |
35 | |
36 | MD5_WORD A, B, C, D; |
37 | |
38 | unsigned char blk[MD5_BLOCK_SIZE]; |
39 | unsigned blk_ptr; |
40 | } ; |
41 | |
42 | void md5_context_init(struct MD5_CONTEXT *); |
43 | void md5_context_hash(struct MD5_CONTEXT *, |
44 | const unsigned char[MD5_BLOCK_SIZE]); |
45 | void md5_context_hashstream(struct MD5_CONTEXT *, const void *, unsigned); |
46 | void md5_context_endstream(struct MD5_CONTEXT *, unsigned long); |
47 | void md5_context_digest(struct MD5_CONTEXT *, MD5_DIGEST); |
48 | |
49 | void md5_context_restore(struct MD5_CONTEXT *, const MD5_DIGEST); |
50 | |
51 | #endif |
52 | |
53 | void md5_digest(const void *msg, unsigned int len, MD5_DIGEST); |
54 | |
55 | char *md5_crypt_redhat(const char *, const char *); |
56 | #define md5_crypt md5_crypt_redhat |
57 | |
58 | const char *md5_hash_courier(const char *); |
dd184caf |
59 | const char *md5_hash_raw(const char *); |
d9898ee8 |
60 | |
61 | #ifdef __cplusplus |
62 | } ; |
63 | #endif |
64 | |
65 | #endif |