4 /* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm
7 /* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
9 License to copy and use this software is granted provided that it
10 is identified as the "RSA Data Security, Inc. MD4 Message-Digest
11 Algorithm" in all material mentioning or referencing this software
14 License is also granted to make and use derivative works provided
15 that such works are identified as "derived from the RSA Data
16 Security, Inc. MD4 Message-Digest Algorithm" in all material
17 mentioning or referencing the derived work.
19 RSA Data Security, Inc. makes no representations concerning either
20 the merchantability of this software or the suitability of this
21 software for any particular purpose. It is provided "as is"
22 without express or implied warranty of any kind.
24 These notices must be retained in any copies of any part of this
25 documentation and/or software.
28 /* PROTOTYPES should be set to one if and only if the compiler supports
29 function argument prototyping.
30 The following makes PROTOTYPES default to 0 if it has not already
31 been defined with C compiler flags.
37 /* POINTER defines a generic pointer type */
38 typedef unsigned char *POINTER
;
40 /* UINT2 defines a two byte word */
41 typedef unsigned short int UINT2
;
43 /* UINT4 defines a four byte word */
44 typedef unsigned int UINT4
;
46 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
47 If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
48 returns an empty list.
52 #define PROTO_LIST(list) list
54 #define PROTO_LIST(list) ()
59 UINT4 state
[4]; /* state (ABCD) */
60 UINT4 count
[2]; /* number of bits, modulo 2^64 (lsb first) */
61 unsigned char buffer
[64]; /* input buffer */
64 void MD4Init
PROTO_LIST ((MD4_CTX
*));
65 void MD4Update PROTO_LIST
66 ((MD4_CTX
*, unsigned char *, unsigned int));
67 void MD4Final
PROTO_LIST ((unsigned char [16], MD4_CTX
*));
69 #define md4_init(contextp) Md4Init(contextp)
70 #define md4_append(contextp,buffer,len) MD4Update(contextp,buffer,len)
71 #define md4_finish(contextp,digest) MD4Final(digest, contextp)