]> jfr.im git - irc/evilnet/x3.git/blame - src/md5.h
remove some debug chatter
[irc/evilnet/x3.git] / src / md5.h
CommitLineData
1c0d5243 1#ifndef _MD5_H
2#define _MD5_H
3
4#ifndef uint8
5#define uint8 unsigned char
6#endif
7
8#ifndef uint32
9#define uint32 unsigned long int
10#endif
11
12typedef struct
13{
14 uint32 total[2];
15 uint32 state[4];
16 uint8 buffer[64];
17}
18md5_context;
19
20void md5_starts( md5_context *ctx );
21void md5_update( md5_context *ctx, uint8 *input, uint32 length );
22void md5_finish( md5_context *ctx, uint8 digest[16] );
23
24#endif /* md5.h */
25
26
27/* ---------------------------------------
28 * OLD CRAP HERE
29 * DELETE THIS SOME DAY
30 *
31 *----------------------------------------*/
32
d76ed9a9 33/* GLOBAL.H - RSAREF types and constants */
34
35/* PROTOTYPES should be set to one if and only if the compiler supports
36 function argument prototyping.
37 The following makes PROTOTYPES default to 0 if it has not already
38 been defined with C compiler flags.
39 */
40#ifndef PROTOTYPES
41#define PROTOTYPES 1
42#endif
43
44/* POINTER defines a generic pointer type */
45typedef unsigned char *POINTER;
46
47/* UINT2 defines a two byte word */
48typedef unsigned short int UINT2;
49
50/* UINT4 defines a four byte word */
2f61d1d7 51#if defined(__alpha) || defined(_LP64) || defined(__LP64__)
d76ed9a9 52typedef unsigned int UINT4;
53#else
54typedef unsigned long int UINT4;
55#endif
56
57/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
58 If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
59 returns an empty list.
60 */
61#if PROTOTYPES
62#define PROTO_LIST(list) list
63#else
64#define PROTO_LIST(list) ()
65#endif
66
67/* MD5.H - header file for MD5C.C */
68
69/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
70rights reserved.
71
72License to copy and use this software is granted provided that it
73is identified as the "RSA Data Security, Inc. MD5 Message-Digest
74Algorithm" in all material mentioning or referencing this software
75or this function.
76
77License is also granted to make and use derivative works provided
78that such works are identified as "derived from the RSA Data
79Security, Inc. MD5 Message-Digest Algorithm" in all material
80mentioning or referencing the derived work.
81
82RSA Data Security, Inc. makes no representations concerning either
83the merchantability of this software or the suitability of this
84software for any particular purpose. It is provided "as is"
85without express or implied warranty of any kind.
86
87These notices must be retained in any copies of any part of this
88documentation and/or software.
89 */
90
91/* MD5 context. */
92typedef struct {
93 UINT4 state[4]; /* state (ABCD) */
94 UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
95 unsigned char buffer[64]; /* input buffer */
96} MD5_CTX;
97
98void MD5Init PROTO_LIST ((MD5_CTX *));
99void MD5Update PROTO_LIST ((MD5_CTX *, unsigned char *, unsigned int));
100void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
101