xref: /freebsd/sbin/ipf/ipftest/md5.h (revision 045c8f526484cb3b97f5fd693987f4376fa43c5f)
1 /*	$FreeBSD$	*/
2 
3 /*
4  ***********************************************************************
5  ** md5.h -- header file for implementation of MD5                    **
6  ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
7  ** Created: 2/17/90 RLR                                              **
8  ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
9  ** Revised (for MD5): RLR 4/27/91                                    **
10  **   -- G modified to have y&~z instead of y&z                       **
11  **   -- FF, GG, HH modified to add in last register done             **
12  **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
13  **   -- distinct additive constant for each step                     **
14  **   -- round 4 added, working mod 7                                 **
15  ***********************************************************************
16  */
17 
18 /*
19  ***********************************************************************
20  ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
21  **                                                                   **
22  ** License to copy and use this software is granted provided that    **
23  ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
24  ** Digest Algorithm" in all material mentioning or referencing this  **
25  ** software or this function.                                        **
26  **                                                                   **
27  ** License is also granted to make and use derivative works          **
28  ** provided that such works are identified as "derived from the RSA  **
29  ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
30  ** material mentioning or referencing the derived work.              **
31  **                                                                   **
32  ** RSA Data Security, Inc. makes no representations concerning       **
33  ** either the merchantability of this software or the suitability    **
34  ** of this software for any particular purpose.  It is provided "as  **
35  ** is" without express or implied warranty of any kind.              **
36  **                                                                   **
37  ** These notices must be retained in any copies of any part of this  **
38  ** documentation and/or software.                                    **
39  ***********************************************************************
40  */
41 
42 #if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H)
43 
44 #ifndef __P
45 #  define	__P(x)	x
46 #endif
47 
48 /* typedef a 32-bit type */
49 typedef unsigned int UINT4;
50 
51 /* Data structure for MD5 (Message-Digest) computation */
52 typedef struct {
53   UINT4 i[2];                   /* number of _bits_ handled mod 2^64 */
54   UINT4 buf[4];                                    /* scratch buffer */
55   unsigned char in[64];                              /* input buffer */
56   unsigned char digest[16];     /* actual digest after MD5Final call */
57 } MD5_CTX;
58 
59 extern void MD5Init(MD5_CTX *);
60 extern void MD5Update(MD5_CTX *, unsigned char *, unsigned int);
61 extern void MD5Final(unsigned char *, MD5_CTX *);
62 
63 #define __MD5_INCLUDE__
64 #endif /* __MD5_INCLUDE__ */
65