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