blob: 2b6d25b36e726d7da01d7f29d2848889993795f3 [file] [log] [blame]
Guido van Rossum13ecc7a1993-11-01 16:19:05 +00001/* MD5.H - header file for MD5C.C
2 */
3
4/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
5rights reserved.
6
7License to copy and use this software is granted provided that it
8is identified as the "RSA Data Security, Inc. MD5 Message-Digest
9Algorithm" in all material mentioning or referencing this software
10or this function.
11
12License is also granted to make and use derivative works provided
13that such works are identified as "derived from the RSA Data
14Security, Inc. MD5 Message-Digest Algorithm" in all material
15mentioning or referencing the derived work.
16
17RSA Data Security, Inc. makes no representations concerning either
18the merchantability of this software or the suitability of this
19software for any particular purpose. It is provided "as is"
20without express or implied warranty of any kind.
21
22These notices must be retained in any copies of any part of this
23documentation and/or software.
24 */
25
26/* ========== include global.h ========== */
27/* GLOBAL.H - RSAREF types and constants
28 */
29
Guido van Rossum13ecc7a1993-11-01 16:19:05 +000030/* POINTER defines a generic pointer type */
31typedef unsigned char *POINTER;
32
Guido van Rossum13ecc7a1993-11-01 16:19:05 +000033/* UINT4 defines a four byte word */
Fred Draked5fadf72000-09-26 05:46:01 +000034#if SIZEOF_LONG == 4
Guido van Rossum13ecc7a1993-11-01 16:19:05 +000035typedef unsigned long int UINT4;
Michael W. Hudson1e1542f2002-05-29 10:32:24 +000036#elif SIZEOF_SHORT == 4
37typedef unsigned short int UINT4;
38#elif INT_MAX == 2147483647
Fred Draked5fadf72000-09-26 05:46:01 +000039typedef unsigned int UINT4;
Guido van Rossumb1236911996-01-12 01:38:49 +000040#endif
Guido van Rossum13ecc7a1993-11-01 16:19:05 +000041
Guido van Rossum13ecc7a1993-11-01 16:19:05 +000042/* ========== End global.h; continue md5.h ========== */
43
44/* MD5 context. */
45typedef struct {
Fred Drake859bad02000-07-10 04:20:57 +000046 UINT4 state[4]; /* state (ABCD) */
47 UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
48 unsigned char buffer[64]; /* input buffer */
Guido van Rossum13ecc7a1993-11-01 16:19:05 +000049} MD5_CTX;
50
Guido van Rossum53d0de41996-05-24 20:51:38 +000051/* Rename all exported symbols to avoid conflicts with similarly named
52 symbols in some systems' standard C libraries... */
53
54#define MD5Init _Py_MD5Init
55#define MD5Update _Py_MD5Update
56#define MD5Final _Py_MD5Final
57
Fred Drake859bad02000-07-10 04:20:57 +000058void MD5Init(MD5_CTX *);
59void MD5Update(MD5_CTX *, unsigned char *, unsigned int);
60void MD5Final(unsigned char [16], MD5_CTX *);