]> diplodocus.org Git - nmh/blob - h/md5.h
uip/sortm.c: Remove unused variable and dlocaltimenow() call.
[nmh] / h / md5.h
1 /* md5.h -- header file for md5 message digest
2 * taken from RFC-1321/Appendices A.1/A.2
3 */
4
5 /*
6 * RSAREF types and constants
7 */
8
9 /*
10 * Use include for nmh/mh
11 */
12
13 #include <h/nmh.h>
14
15 /*
16 * We need this for uint32_t
17 */
18
19 #include <inttypes.h>
20
21 /*
22 * Use prototypes for nmh/mh
23 */
24 #define PROTOTYPES 1
25
26 /*
27 * PROTOTYPES should be set to one if and only if the compiler
28 * supports function argument prototyping. The following makes
29 * PROTOTYPES default to 0 if it has not already been defined
30 * with C compiler flags.
31 */
32 #ifndef PROTOTYPES
33 #define PROTOTYPES 0
34 #endif
35
36 /* POINTER defines a generic pointer type */
37 typedef unsigned char *POINTER;
38
39 /* UINT2 defines a two byte word */
40 typedef unsigned short int UINT2;
41
42 /* UINT4 defines a four byte word */
43 typedef uint32_t UINT4;
44
45 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
46 If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
47 returns an empty list.
48 */
49 #if PROTOTYPES
50 #define PROTO_LIST(list) list
51 #else
52 #define PROTO_LIST(list) ()
53 #endif
54
55 /* MD5.H - header file for MD5C.C
56 */
57
58 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
59 rights reserved.
60
61 License to copy and use this software is granted provided that it
62 is identified as the "RSA Data Security, Inc. MD5 Message-Digest
63 Algorithm" in all material mentioning or referencing this software
64 or this function.
65
66 License is also granted to make and use derivative works provided
67 that such works are identified as "derived from the RSA Data
68 Security, Inc. MD5 Message-Digest Algorithm" in all material
69 mentioning or referencing the derived work.
70
71 RSA Data Security, Inc. makes no representations concerning either
72 the merchantability of this software or the suitability of this
73 software for any particular purpose. It is provided "as is"
74 without express or implied warranty of any kind.
75
76 These notices must be retained in any copies of any part of this
77 documentation and/or software.
78 */
79
80 /* MD5 context. */
81 typedef struct {
82 UINT4 state[4]; /* state (ABCD) */
83 UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
84 unsigned char buffer[64]; /* input buffer */
85 } MD5_CTX;
86
87 void MD5Init PROTO_LIST ((MD5_CTX *));
88 void MD5Update PROTO_LIST ((MD5_CTX *, unsigned char *, unsigned int));
89 void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));