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