1145519Sdarrenr/*	$FreeBSD$	*/
2145510Sdarrenr
3145510Sdarrenr/*
4145510Sdarrenr ***********************************************************************
5145510Sdarrenr ** md5.h -- header file for implementation of MD5                    **
6145510Sdarrenr ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
7145510Sdarrenr ** Created: 2/17/90 RLR                                              **
8145510Sdarrenr ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
9145510Sdarrenr ** Revised (for MD5): RLR 4/27/91                                    **
10145510Sdarrenr **   -- G modified to have y&~z instead of y&z                       **
11145510Sdarrenr **   -- FF, GG, HH modified to add in last register done             **
12145510Sdarrenr **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
13145510Sdarrenr **   -- distinct additive constant for each step                     **
14145510Sdarrenr **   -- round 4 added, working mod 7                                 **
15145510Sdarrenr ***********************************************************************
16145510Sdarrenr */
17145510Sdarrenr
18145510Sdarrenr/*
19145510Sdarrenr ***********************************************************************
20145510Sdarrenr ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
21145510Sdarrenr **                                                                   **
22145510Sdarrenr ** License to copy and use this software is granted provided that    **
23145510Sdarrenr ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
24145510Sdarrenr ** Digest Algorithm" in all material mentioning or referencing this  **
25145510Sdarrenr ** software or this function.                                        **
26145510Sdarrenr **                                                                   **
27145510Sdarrenr ** License is also granted to make and use derivative works          **
28145510Sdarrenr ** provided that such works are identified as "derived from the RSA  **
29145510Sdarrenr ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
30145510Sdarrenr ** material mentioning or referencing the derived work.              **
31145510Sdarrenr **                                                                   **
32145510Sdarrenr ** RSA Data Security, Inc. makes no representations concerning       **
33145510Sdarrenr ** either the merchantability of this software or the suitability    **
34145510Sdarrenr ** of this software for any particular purpose.  It is provided "as  **
35145510Sdarrenr ** is" without express or implied warranty of any kind.              **
36145510Sdarrenr **                                                                   **
37145510Sdarrenr ** These notices must be retained in any copies of any part of this  **
38145510Sdarrenr ** documentation and/or software.                                    **
39145510Sdarrenr ***********************************************************************
40145510Sdarrenr */
41145510Sdarrenr
42172776Sdarrenr#if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H)
43145510Sdarrenr
44145510Sdarrenr#ifndef __P
45145510Sdarrenr# ifdef __STDC__
46145510Sdarrenr#  define	__P(x)	x
47145510Sdarrenr# else
48145510Sdarrenr#  define	__P(x)	()
49145510Sdarrenr# endif
50145510Sdarrenr#endif
51145510Sdarrenr#ifndef __STDC__
52145510Sdarrenr# undef		const
53145510Sdarrenr# define	const
54145510Sdarrenr#endif
55145510Sdarrenr
56145510Sdarrenr/* typedef a 32-bit type */
57145510Sdarrenrtypedef unsigned int UINT4;
58145510Sdarrenr
59145510Sdarrenr/* Data structure for MD5 (Message-Digest) computation */
60145510Sdarrenrtypedef struct {
61145510Sdarrenr  UINT4 i[2];                   /* number of _bits_ handled mod 2^64 */
62145510Sdarrenr  UINT4 buf[4];                                    /* scratch buffer */
63145510Sdarrenr  unsigned char in[64];                              /* input buffer */
64145510Sdarrenr  unsigned char digest[16];     /* actual digest after MD5Final call */
65145510Sdarrenr} MD5_CTX;
66145510Sdarrenr
67145510Sdarrenrextern void MD5Init __P((MD5_CTX *));
68145510Sdarrenrextern void MD5Update __P((MD5_CTX *, unsigned char *, unsigned int));
69145510Sdarrenrextern void MD5Final __P((unsigned char *, MD5_CTX *));
70145510Sdarrenr
71145510Sdarrenr#define __MD5_INCLUDE__
72145510Sdarrenr#endif /* __MD5_INCLUDE__ */
73