]> git.ozlabs.org Git - ppp.git/blob - pppd/md4.h
include Makedefs
[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 /* MDstruct is the data structure for a message digest computation.
12 */
13 typedef struct {
14         unsigned int buffer[4]; /* Holds 4-word result of MD computation */
15         unsigned char count[8]; /* Number of bits processed so far */
16         unsigned int done;      /* Nonzero means MD computation finished */
17 } MD4_CTX;
18
19 /* MD4Init(MD4_CTX *)
20 ** Initialize the MD4_CTX prepatory to doing a message digest
21 ** computation.
22 */
23 extern void MD4Init __P((MD4_CTX *MD));
24
25 /* MD4Update(MD,X,count)
26 ** Input: X -- a pointer to an array of unsigned characters.
27 **        count -- the number of bits of X to use (an unsigned int).
28 ** Updates MD using the first "count" bits of X.
29 ** The array pointed to by X is not modified.
30 ** If count is not a multiple of 8, MD4Update uses high bits of
31 ** last byte.
32 ** This is the basic input routine for a user.
33 ** The routine terminates the MD computation when count < 512, so
34 ** every MD computation should end with one call to MD4Update with a
35 ** count less than 512.  Zero is OK for a count.
36 */
37 extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count));
38
39 /* MD4Print(MD)
40 ** Prints message digest buffer MD as 32 hexadecimal digits.
41 ** Order is from low-order byte of buffer[0] to high-order byte
42 ** of buffer[3].
43 ** Each byte is printed with high-order hexadecimal digit first.
44 */
45 extern void MD4Print __P((MD4_CTX *));
46
47 /* MD4Final(buf, MD)
48 ** Returns message digest from MD and terminates the message
49 ** digest computation.
50 */
51 extern void MD4Final __P((unsigned char *, MD4_CTX *));
52
53 /*
54 ** End of md4.h
55 ****************************(cut)***********************************/