3 /** @file md5.h Functions to create MD5 checksums. */
6 Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
8 This software is provided 'as-is', without any express or implied
9 warranty. In no event will the authors be held liable for any damages
10 arising from the use of this software.
12 Permission is granted to anyone to use this software for any purpose,
13 including commercial applications, and to alter it and redistribute it
14 freely, subject to the following restrictions:
16 1. The origin of this software must not be misrepresented; you must not
17 claim that you wrote the original software. If you use this software
18 in a product, an acknowledgment in the product documentation would be
19 appreciated but is not required.
20 2. Altered source versions must be plainly marked as such, and must not be
21 misrepresented as being the original software.
22 3. This notice may not be removed or altered from any source distribution.
30 Independent implementation of MD5 (RFC 1321).
32 This code implements the MD5 Algorithm defined in RFC 1321, whose
34 http://www.ietf.org/rfc/rfc1321.txt
35 The code is derived from the text of the RFC, including the test suite
36 (section A.5) but excluding the rest of Appendix A. It does not include
37 any code or documentation that is identified in the RFC as being
40 The original and principal author of md5.h is L. Peter Deutsch
41 <ghost@aladdin.com>. Other authors are noted in the change history
42 that follows (in reverse chronological order):
44 2007-12-24 Changed to C++ and adapted to OpenTTD source
45 2002-04-13 lpd Removed support for non-ANSI compilers; removed
46 references to Ghostscript; clarified derivation from RFC 1321;
47 now handles byte order either statically or dynamically.
48 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
49 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
50 added conditionalization for C++ compilation from Martin
51 Purschke <purschke@bnl.gov>.
52 1999-05-03 lpd Original version.
60 uint32 count
[2]; ///< message length in bits, lsw first
61 uint32 abcd
[4]; ///< digest buffer
62 uint8 buf
[64]; ///< accumulate block
64 void Process(const uint8
*data
);
68 void Append(const void *data
, const size_t nbytes
);
69 void Finish(uint8 digest
[16]);
72 #endif /* MD5_INCLUDED */