home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / PSION / MISC / PSI-KEY / MD4.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-07  |  1.7 KB  |  48 lines

  1. /*     Define __ARGS for Turbo C    */
  2. #define    __ARGS(X)    X
  3.  
  4. /* 
  5.  *
  6.  * md4.h -- Header file for implementation of MD4 Message Digest Algorithm
  7.  * Updated: 2/13/90 by Ronald L. Rivest
  8.  * (C) 1990 RSA Data Security, Inc.
  9.  * Reformatted and de-linted - 2/12/91 Phil Karn
  10.  */
  11.  
  12. /* MDstruct is the data structure for a message digest computation. */
  13. typedef struct {
  14.     unsigned long 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. } MDstruct, *MDptr;
  18.  
  19. /* MDbegin(MD)
  20.  * Input: MD -- an MDptr
  21.  * Initialize the MDstruct prepatory to doing a message digest computation.
  22.  */
  23. extern void MDbegin __ARGS((MDptr MDp));
  24.  
  25. /* MDupdate(MD,X,count)
  26.  * Input: MD -- an MDptr
  27.  *        X -- a pointer to an array of unsigned characters.
  28.  *        count -- the number of bits of X to use (an unsigned int).
  29.  * Updates MD using the first ``count'' bits of X.
  30.  * The array pointed to by X is not modified.
  31.  * If count is not a multiple of 8, MDupdate uses high bits of 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 MDupdate with a
  35.  * count less than 512.  Zero is OK for a count.
  36.  */
  37. extern void MDupdate __ARGS((MDptr MDp,unsigned char *X,unsigned int count));
  38.  
  39. /* MDprint(MD)
  40.  * Input: MD -- an MDptr
  41.  * Prints message digest buffer MD as 32 hexadecimal digits.
  42.  * Order is from low-order byte of buffer[0] to high-order byte of buffer[3].
  43.  * Each byte is printed with high-order hexadecimal digit first.
  44.  */
  45. extern void MDprint __ARGS((MDptr MDp));
  46.  
  47. /* End of md4.h */
  48.