1/* $Id: md4.h,v 1.1.1.1 2008/10/15 03:31:22 james26_jang Exp $ */
2
3#ifndef _MD4_H_
4#define _MD4_H_
5
6/*
7 * md4.h, copied from src/router/ppp/pppd to src/include/bcmcrypto for general use
8 *
9 * $Id: md4.h,v 1.1.1.1 2008/10/15 03:31:22 james26_jang Exp $
10 *
11** ********************************************************************
12** md4.h -- Header file for implementation of                        **
13** MD4 Message Digest Algorithm                                      **
14** Updated: 2/13/90 by Ronald L. Rivest                              **
15** (C) 1990 RSA Data Security, Inc.                                  **
16** ********************************************************************
17*/
18
19#ifndef __P
20# if defined(__STDC__) || defined(__GNUC__)
21#  define __P(x) x
22# else
23#  define __P(x) ()
24# endif
25#endif
26
27
28/* MDstruct is the data structure for a message digest computation.
29*/
30typedef struct {
31	unsigned int buffer[4]; /* Holds 4-word result of MD computation */
32	unsigned char count[8]; /* Number of bits processed so far */
33	unsigned int done;      /* Nonzero means MD computation finished */
34} MD4_CTX;
35
36/* MD4Init(MD4_CTX *)
37** Initialize the MD4_CTX prepatory to doing a message digest
38** computation.
39*/
40extern void MD4Init __P((MD4_CTX *MD));
41
42/* MD4Update(MD,X,count)
43** Input: X -- a pointer to an array of unsigned characters.
44**        count -- the number of bits of X to use (an unsigned int).
45** Updates MD using the first "count" bits of X.
46** The array pointed to by X is not modified.
47** If count is not a multiple of 8, MD4Update uses high bits of
48** last byte.
49** This is the basic input routine for a user.
50** The routine terminates the MD computation when count < 512, so
51** every MD computation should end with one call to MD4Update with a
52** count less than 512.  Zero is OK for a count.
53*/
54extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count));
55
56/* MD4Print(MD)
57** Prints message digest buffer MD as 32 hexadecimal digits.
58** Order is from low-order byte of buffer[0] to high-order byte
59** of buffer[3].
60** Each byte is printed with high-order hexadecimal digit first.
61*/
62extern void MD4Print __P((MD4_CTX *));
63
64/* MD4Final(buf, MD)
65** Returns message digest from MD and terminates the message
66** digest computation.
67*/
68extern void MD4Final __P((unsigned char *, MD4_CTX *));
69
70/*
71** End of md4.h
72****************************(cut)***********************************/
73
74#endif /* _MD4_H_ */
75