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