13
13
along with this program; if not, write to the Free Software
14
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
/* MD5.H - header file for MD5C.C
20
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
23
License to copy and use this software is granted provided that it
24
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
25
Algorithm" in all material mentioning or referencing this software
28
License is also granted to make and use derivative works provided
29
that such works are identified as "derived from the RSA Data
30
Security, Inc. MD5 Message-Digest Algorithm" in all material
31
mentioning or referencing the derived work.
33
RSA Data Security, Inc. makes no representations concerning either
34
the merchantability of this software or the suitability of this
35
software for any particular purpose. It is provided "as is"
36
without express or implied warranty of any kind.
38
These notices must be retained in any copies of any part of this
39
documentation and/or software.
42
/* GLOBAL.H - RSAREF types and constants
45
/* PROTOTYPES should be set to one if and only if the compiler supports
46
function argument prototyping.
47
The following makes PROTOTYPES default to 0 if it has not already
48
been defined with C compiler flags.
51
/* egcs 1.1.2 under linux didn't defined it.... :( */
54
#define PROTOTYPES 1 /* Assume prototypes */
57
/* POINTER defines a generic pointer type */
58
typedef unsigned char *POINTER;
60
/* UINT2 defines a two byte word */
61
typedef uint16 UINT2; /* Fix for MySQL / Alpha */
63
/* UINT4 defines a four byte word */
64
typedef uint32 UINT4; /* Fix for MySQL / Alpha */
66
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
67
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
68
returns an empty list.
71
#define PROTO_LIST(list) list
73
#define PROTO_LIST(list) ()
16
/* See md5.c for explanation and copyright information. */
19
* $FreeBSD: src/contrib/cvs/lib/md5.h,v 1.2 1999/12/11 15:10:02 peter Exp $
22
/* Unlike previous versions of this code, uint32 need not be exactly
23
32 bits, merely 32 bits or more. Choosing a data type which is 32
24
bits instead of 64 is not important; speed is considerably more
25
important. ANSI guarantees that "unsigned long" will be big enough,
26
and always using it seems to have few disadvantages. */
27
typedef uint32 cvs_uint32;
77
UINT4 state[4]; /* state (ABCD) */
78
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
79
unsigned char buffer[64]; /* input buffer */
85
void my_MD5Init PROTO_LIST ((my_MD5_CTX *));
86
void my_MD5Update PROTO_LIST
87
((my_MD5_CTX *, unsigned char *, unsigned int));
88
void my_MD5Final PROTO_LIST ((unsigned char [16], my_MD5_CTX *));
38
void my_MD5Init (my_MD5Context *context);
39
void my_MD5Update (my_MD5Context *context,
40
unsigned char const *buf, unsigned len);
41
void my_MD5Final (unsigned char digest[16],
42
my_MD5Context *context);
48
#define MY_MD5_HASH(digest,buf,len) \
52
my_MD5Update (&ctx, buf, len); \
53
my_MD5Final (digest, &ctx); \