2 * md5 - RSA Data Security, Inc. MD5 Message-Digest Algorithm
4 * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO
5 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER-
6 * CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT
7 * NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
8 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
9 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
11 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * This file is not covered under version 2.1 of the GNU LGPL.
21 ***********************************************************************
22 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
24 ** License to copy and use this software is granted provided that **
25 ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
26 ** Digest Algorithm" in all material mentioning or referencing this **
27 ** software or this function. **
29 ** License is also granted to make and use derivative works **
30 ** provided that such works are identified as "derived from the RSA **
31 ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
32 ** material mentioning or referencing the derived work. **
34 ** RSA Data Security, Inc. makes no representations concerning **
35 ** either the merchantability of this software or the suitability **
36 ** of this software for any particular purpose. It is provided "as **
37 ** is" without express or implied warranty of any kind. **
39 ** These notices must be retained in any copies of any part of this **
40 ** documentation and/or software. **
41 ***********************************************************************
44 #if !defined(__MD5_H__)
47 /* MD5_CHUNKSIZE must be a power of 2 - fixed value defined by the algorithm */
48 #define MD5_CHUNKSIZE (1<<6)
49 #define MD5_CHUNKWORDS (MD5_CHUNKSIZE/sizeof(USB32))
51 /* MD5_DIGESTSIZE is a the length of the digest as defined by the algorithm */
52 #define MD5_DIGESTSIZE (16)
53 #define MD5_DIGESTWORDS (MD5_DIGESTSIZE/sizeof(USB32))
55 /* MD5_LOW - where low 32 bits of 64 bit count is stored during final */
58 /* MD5_HIGH - where high 32 bits of 64 bit count is stored during final */
62 * MD5COUNT(MD5_CTX*, USB32) - update the 64 bit count in an MD5_CTX
64 * We will count bytes and convert to bit count during the final
67 #define MD5COUNT(md5info, count) { \
69 tmp_countLo = (md5info)->countLo; \
70 if (((md5info)->countLo += (count)) < tmp_countLo) { \
71 (md5info)->countHi++; \
76 * Data structure for MD5 (Message-Digest) computation
79 USB32 digest[MD5_DIGESTWORDS]; /* message digest */
80 USB32 countLo; /* 64 bit count: bits 3-34 */
81 USB32 countHi; /* 64 bit count: bits 35-63 (64-66 ignored) */
82 USB32 datalen; /* length of data in inp.inp_USB8 */
83 USB32 data[MD5_CHUNKWORDS]; /* USB32 chunk buffer */
86 #endif /* __MD5_H__ */