]> code.citadel.org Git - citadel.git/blob - rss2ctdl/md5.h
5003e6d09157a3087b2ac04813e43a0057658c0f
[citadel.git] / rss2ctdl / md5.h
1 /*
2  * $Id$
3  * 
4  * Copyright 2003-2004 Oliver Feiler <kiza@kcore.de>
5  *
6  * md5.h
7  *
8  * This code has been slightly modified from its original.
9  * The endian check via evaluating endian.h has been
10  * replaced with the code in void byteReverse().
11  */
12
13 /*
14  * This code implements the MD5 message-digest algorithm.
15  * The algorithm is due to Ron Rivest.  This code was
16  * written by Colin Plumb in 1993, no copyright is claimed.
17  * This code is in the public domain; do with it what you wish.
18  *
19  * Equivalent code is available from RSA Data Security, Inc.
20  * This code has been tested against that, and is equivalent,
21  * except that you don't need to include two pages of legalese
22  * with every copy.
23  *
24  * To compute the message digest of a chunk of bytes, declare an
25  * MD5Context structure, pass it to MD5Init, call MD5Update as
26  * needed on buffers full of bytes, and then call MD5Final, which
27  * will fill a supplied 16-byte array with the digest.
28  */
29
30 #ifndef MD5_H
31 #define MD5_H
32
33 #ifdef __alpha
34 typedef unsigned int uint32;
35 #else
36 typedef unsigned long uint32;
37 #endif
38
39 struct MD5Context {
40         uint32 buf[4];
41         uint32 bits[2];
42         unsigned char in[64];
43 };
44
45 void MD5Init(struct MD5Context *context);
46 void MD5Update(struct MD5Context *context, unsigned char const *buf,
47                unsigned len);
48 void MD5Final(unsigned char digest[16], struct MD5Context *context);
49 void MD5Transform(uint32 buf[4], uint32 const in[16]);
50
51 /*
52  * This is needed to make RSAREF happy on some MS-DOS compilers.
53  */
54 typedef struct MD5Context MD5_CTX;
55
56 #endif /* !MD5_H */