1996-05-28 08:52:28 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
** ********************************************************************
|
|
|
|
** md4.h -- Header file for implementation of **
|
|
|
|
** MD4 Message Digest Algorithm **
|
|
|
|
** Updated: 2/13/90 by Ronald L. Rivest **
|
|
|
|
** (C) 1990 RSA Data Security, Inc. **
|
|
|
|
** ********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* MDstruct is the data structure for a message digest computation.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
1998-02-04 09:40:34 +08:00
|
|
|
unsigned int buffer[4]; /* Holds 4-word result of MD computation */
|
|
|
|
unsigned char count[8]; /* Number of bits processed so far */
|
|
|
|
unsigned int done; /* Nonzero means MD computation finished */
|
|
|
|
} MD4_CTX;
|
1996-05-28 08:52:28 +08:00
|
|
|
|
1998-02-04 09:40:34 +08:00
|
|
|
/* MD4Init(MD4_CTX *)
|
|
|
|
** Initialize the MD4_CTX prepatory to doing a message digest
|
1996-05-28 08:52:28 +08:00
|
|
|
** computation.
|
|
|
|
*/
|
1998-02-04 09:40:34 +08:00
|
|
|
extern void MD4Init __P((MD4_CTX *MD));
|
1996-05-28 08:52:28 +08:00
|
|
|
|
1998-02-04 09:40:34 +08:00
|
|
|
/* MD4Update(MD,X,count)
|
|
|
|
** Input: X -- a pointer to an array of unsigned characters.
|
1996-05-28 08:52:28 +08:00
|
|
|
** count -- the number of bits of X to use (an unsigned int).
|
|
|
|
** Updates MD using the first "count" bits of X.
|
|
|
|
** The array pointed to by X is not modified.
|
1998-02-04 09:40:34 +08:00
|
|
|
** If count is not a multiple of 8, MD4Update uses high bits of
|
1996-05-28 08:52:28 +08:00
|
|
|
** last byte.
|
|
|
|
** This is the basic input routine for a user.
|
|
|
|
** The routine terminates the MD computation when count < 512, so
|
1998-02-04 09:40:34 +08:00
|
|
|
** every MD computation should end with one call to MD4Update with a
|
1996-05-28 08:52:28 +08:00
|
|
|
** count less than 512. Zero is OK for a count.
|
|
|
|
*/
|
1998-02-04 09:40:34 +08:00
|
|
|
extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count));
|
1996-05-28 08:52:28 +08:00
|
|
|
|
1998-02-04 09:40:34 +08:00
|
|
|
/* MD4Print(MD)
|
1996-05-28 08:52:28 +08:00
|
|
|
** Prints message digest buffer MD as 32 hexadecimal digits.
|
|
|
|
** Order is from low-order byte of buffer[0] to high-order byte
|
|
|
|
** of buffer[3].
|
|
|
|
** Each byte is printed with high-order hexadecimal digit first.
|
|
|
|
*/
|
1998-02-04 09:40:34 +08:00
|
|
|
extern void MD4Print __P((MD4_CTX *));
|
|
|
|
|
|
|
|
/* MD4Final(buf, MD)
|
|
|
|
** Returns message digest from MD and terminates the message
|
|
|
|
** digest computation.
|
|
|
|
*/
|
|
|
|
extern void MD4Final __P((unsigned char *, MD4_CTX *));
|
1996-05-28 08:52:28 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
** End of md4.h
|
|
|
|
****************************(cut)***********************************/
|