7
* If Squid is compiled with OpenSSL then we use the MD5 routines
8
* from there via some wrapper macros, and the rest of this file is ignored..
11
#if HAVE_OPENSSL_MD5_H
12
#include <openssl/md5.h>
14
#error Cannot find OpenSSL headers
17
/* Hack to adopt Squid to the OpenSSL syntax */
18
#define MD5_DIGEST_CHARS MD5_DIGEST_LENGTH
20
#define MD5Init MD5_Init
21
#define MD5Update MD5_Update
22
#define MD5Final MD5_Final
24
#else /* USE_OPENSSL */
27
* This is the header file for the MD5 message-digest algorithm.
28
* The algorithm is due to Ron Rivest. This code was
29
* written by Colin Plumb in 1993, no copyright is claimed.
30
* This code is in the public domain; do with it what you wish.
32
* Equivalent code is available from RSA Data Security, Inc.
33
* This code has been tested against that, and is equivalent,
34
* except that you don't need to include two pages of legalese
37
* To compute the message digest of a chunk of bytes, declare an
38
* MD5Context structure, pass it to MD5Init, call MD5Update as
39
* needed on buffers full of bytes, and then call MD5Final, which
40
* will fill a supplied 16-byte array with the digest.
42
* Changed so as no longer to depend on Colin Plumb's `usual.h'
43
* header definitions; now uses stuff from dpkg's config.h
44
* - Ian Jackson <ian@chiark.greenend.org.uk>.
45
* Still in the public domain.
47
* Changed MD5Update to take a void * for easier use and some other
48
* minor cleanup. - Henrik Nordstrom <henrik@henriknordstrom.net>.
49
* Still in the public domain.
53
#include "squid_types.h"
55
typedef struct MD5Context {
61
SQUIDCEXTERN void MD5Init(struct MD5Context *context);
62
SQUIDCEXTERN void MD5Update(struct MD5Context *context, const void *buf, unsigned len);
63
SQUIDCEXTERN void MD5Final(uint8_t digest[16], struct MD5Context *context);
64
SQUIDCEXTERN void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
66
#define MD5_DIGEST_CHARS 16
68
#endif /* USE_OPENSSL */
69
#endif /* SQUID_MD5_H */