|
|
1.1 ! root 1: /* ! 2: ** ************************************************************************** ! 3: ** md4.h -- Header file for implementation of MD4 Message Digest Algorithm ** ! 4: ** Updated: 2/13/90 by Ronald L. Rivest ** ! 5: ** (C) 1990 RSA Data Security, Inc. ** ! 6: ** Data type Word32Type added by Peter Pearson, 90.08.02. ** ! 7: ** ************************************************************************** ! 8: */ ! 9: ! 10: /* ! 11: License to copy and use this software is granted provided it is ! 12: identified as the "RSA Data Security, Inc. MD4 Message Digest ! 13: Algorithm" in all materials mentioning or referencing this software, ! 14: function, or document. ! 15: ! 16: License is also granted to make derivative works provided that such ! 17: works are identified as "derived from the RSA Data Security, Inc. MD4 ! 18: Message Digest Algorithm" in all material mentioning or referencing ! 19: the derived work. ! 20: ! 21: RSA Data Security, Inc. makes no representations concerning the ! 22: merchantability of this algorithm or software or their suitability ! 23: for any specific purpose. It is provided "as is" without express or ! 24: implied warranty of any kind. ! 25: ! 26: These notices must be retained in any copies of any part of this ! 27: documentation and/or software. ! 28: */ ! 29: ! 30: typedef unsigned long Word32Type ; ! 31: ! 32: /* MDstruct is the data structure for a message digest computation. ! 33: */ ! 34: typedef struct { ! 35: Word32Type buffer[4]; /* Holds 4-word result of MD computation */ ! 36: unsigned char count[8]; /* Number of bits processed so far */ ! 37: unsigned int done; /* Nonzero means MD computation finished */ ! 38: } MDstruct, *MDptr; ! 39: ! 40: /* MDbegin(MD) ! 41: ** Input: MD -- an MDptr ! 42: ** Initialize the MDstruct prepatory to doing a message digest computation. ! 43: */ ! 44: extern void MDbegin(MDptr MDp) ; ! 45: ! 46: /* MDupdate(MD,X,count) ! 47: ** Input: MD -- an MDptr ! 48: ** X -- a pointer to an array of unsigned characters. ! 49: ** count -- the number of bits of X to use (an unsigned int). ! 50: ** Updates MD using the first ``count'' bits of X. ! 51: ** The array pointed to by X is not modified. ! 52: ** If count is not a multiple of 8, MDupdate uses high bits of last byte. ! 53: ** This is the basic input routine for a user. ! 54: ** The routine terminates the MD computation when count < 512, so ! 55: ** every MD computation should end with one call to MDupdate with a ! 56: ** count less than 512. Zero is OK for a count. ! 57: */ ! 58: extern void MDupdate(MDptr MDp, unsigned char *X, Word32Type count) ; ! 59: ! 60: ! 61: /* MDprint(MD) ! 62: ** Input: MD -- an MDptr ! 63: ** Prints message digest buffer MD as 32 hexadecimal digits. ! 64: ** Order is from low-order byte of buffer[0] to high-order byte of buffer[3]. ! 65: ** Each byte is printed with high-order hexadecimal digit first. ! 66: */ ! 67: extern void MDprint(MDptr MDp) ; ! 68: ! 69: /* ! 70: ** End of md4.h ! 71: */ ! 72:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.