]>
git.ipfire.org Git - thirdparty/squid.git/blob - include/md5.h
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
13 #include <nettle/md5.h>
15 typedef struct md5_ctx SquidMD5_CTX
;
17 #define SquidMD5Init(c) md5_init((c))
18 #define SquidMD5Update(c,b,l) md5_update((c), (l), (const uint8_t *)(b))
19 #define SquidMD5Final(d,c) md5_digest((c), MD5_DIGEST_SIZE, (uint8_t *)(d))
21 #define SQUID_MD5_DIGEST_LENGTH MD5_DIGEST_SIZE
25 * This is the header file for the MD5 message-digest algorithm.
26 * The algorithm is due to Ron Rivest. This code was
27 * written by Colin Plumb in 1993, no copyright is claimed.
28 * This code is in the public domain; do with it what you wish.
30 * Equivalent code is available from RSA Data Security, Inc.
31 * This code has been tested against that, and is equivalent,
32 * except that you don't need to include two pages of legalese
35 * To compute the message digest of a chunk of bytes, declare an
36 * MD5Context structure, pass it to MD5Init, call MD5Update as
37 * needed on buffers full of bytes, and then call MD5Final, which
38 * will fill a supplied 16-byte array with the digest.
40 * Changed so as no longer to depend on Colin Plumb's `usual.h'
41 * header definitions; now uses stuff from dpkg's config.h
42 * - Ian Jackson <ian@chiark.greenend.org.uk>.
43 * Still in the public domain.
45 * Changed MD5Update to take a void * for easier use and some other
46 * minor cleanup. - Henrik Nordstrom <henrik@henriknordstrom.net>.
47 * Still in the public domain.
49 * Prefixed all symbols with "Squid" so they don't collide with
50 * other libraries. Duane Wessels <wessels@squid-cache.org>.
51 * Still in the public domain.
55 typedef struct SquidMD5Context
{
61 SQUIDCEXTERN
void SquidMD5Init(struct SquidMD5Context
*context
);
62 SQUIDCEXTERN
void SquidMD5Update(struct SquidMD5Context
*context
, const void *buf
, unsigned len
);
63 SQUIDCEXTERN
void SquidMD5Final(uint8_t digest
[16], struct SquidMD5Context
*context
);
64 SQUIDCEXTERN
void SquidMD5Transform(uint32_t buf
[4], uint32_t const in
[16]);
66 #define SQUID_MD5_DIGEST_LENGTH 16
68 #endif /* HAVE_NETTLE_MD5_H */
70 #endif /* SQUID_MD5_H */