1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License as
4 * published by the Free Software Foundation; either version 2 of
5 * the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15 * MA 02111-1307 USA
16 */
17
18#ifndef _MD4_H_
19#define _MD4_H_
20
21/*
22 * md4.h, copied from src/router/ppp/pppd to src/include/bcmcrypto for general use
23 *
24 *
25** ********************************************************************
26** md4.h -- Header file for implementation of                        **
27** MD4 Message Digest Algorithm                                      **
28** Updated: 2/13/90 by Ronald L. Rivest                              **
29** (C) 1990 RSA Data Security, Inc.                                  **
30** ********************************************************************
31*/
32
33#ifndef __P
34# if defined(__STDC__) || defined(__GNUC__)
35#  define __P(x) x
36# else
37#  define __P(x) ()
38# endif
39#endif
40
41
42/* MDstruct is the data structure for a message digest computation.
43*/
44typedef struct {
45	unsigned int buffer[4]; /* Holds 4-word result of MD computation */
46	unsigned char count[8]; /* Number of bits processed so far */
47	unsigned int done;      /* Nonzero means MD computation finished */
48} MD4_CTX;
49
50/* MD4Init(MD4_CTX *)
51** Initialize the MD4_CTX prepatory to doing a message digest
52** computation.
53*/
54extern void MD4Init __P((MD4_CTX *MD));
55
56/* MD4Update(MD,X,count)
57** Input: X -- a pointer to an array of unsigned characters.
58**        count -- the number of bits of X to use (an unsigned int).
59** Updates MD using the first "count" bits of X.
60** The array pointed to by X is not modified.
61** If count is not a multiple of 8, MD4Update uses high bits of
62** last byte.
63** This is the basic input routine for a user.
64** The routine terminates the MD computation when count < 512, so
65** every MD computation should end with one call to MD4Update with a
66** count less than 512.  Zero is OK for a count.
67*/
68extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count));
69
70/* MD4Print(MD)
71** Prints message digest buffer MD as 32 hexadecimal digits.
72** Order is from low-order byte of buffer[0] to high-order byte
73** of buffer[3].
74** Each byte is printed with high-order hexadecimal digit first.
75*/
76extern void MD4Print __P((MD4_CTX *));
77
78/* MD4Final(buf, MD)
79** Returns message digest from MD and terminates the message
80** digest computation.
81*/
82extern void MD4Final __P((unsigned char *, MD4_CTX *));
83
84/*
85** End of md4.h
86****************************(cut)***********************************/
87
88#endif /* _MD4_H_ */
89