2 * ** **************************************************************************
3 * ** md5.h -- Header file for implementation of MD5 Message Digest Algorithm **
4 * ** Updated: 2/13/90 by Ronald L. Rivest **
5 * ** (C) 1990 RSA Data Security, Inc. **
6 * ** **************************************************************************
18 * MDstruct is the data structure for a message digest computation.
21 unsigned int buffer[4]; /* Holds 4-word result of MD computation */
22 unsigned char count[8]; /* Number of bits processed so far */
23 unsigned int done; /* Nonzero means MD computation finished */
28 * ** Input: MD -- an MDptr
29 * ** Initialize the MDstruct prepatory to doing a message digest computation.
31 extern void MDbegin(MDptr);
34 * MDupdate(MD,X,count)
35 * ** Input: MD -- an MDptr
36 * ** 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, MDupdate uses high bits of 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 MDupdate with a
44 * ** count less than 512. Zero is OK for a count.
46 extern int MDupdate(MDptr, unsigned char *, unsigned int);
50 * ** Input: MD -- an MDptr
51 * ** Prints message digest buffer MD as 32 hexadecimal digits.
52 * ** Order is from low-order byte of buffer[0] to high-order byte of buffer[3].
53 * ** Each byte is printed with high-order hexadecimal digit first.
55 extern void MDprint(MDptr);
57 int MDchecksum(u_char * data, size_t len, u_char * mac,
59 int MDsign(u_char * data, size_t len, u_char * mac,
60 size_t maclen, u_char * secret,
62 void MDget(MDstruct * MD, u_char * buf, size_t buflen);
66 * ****************************(cut)****************************************