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