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