md4.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. ** ********************************************************************
  3. ** md4.h -- Header file for implementation of **
  4. ** MD4 Message Digest Algorithm **
  5. ** Updated: 2/13/90 by Ronald L. Rivest **
  6. ** (C) 1990 RSA Data Security, Inc. **
  7. ** ********************************************************************
  8. */
  9. #ifndef __P
  10. # if defined(__STDC__) || defined(__GNUC__)
  11. # define __P(x) x
  12. # else
  13. # define __P(x) ()
  14. # endif
  15. #endif
  16. /* MDstruct is the data structure for a message digest computation.
  17. */
  18. typedef struct {
  19. unsigned int buffer[4]; /* Holds 4-word result of MD computation */
  20. unsigned char count[8]; /* Number of bits processed so far */
  21. unsigned int done; /* Nonzero means MD computation finished */
  22. } MD4_CTX;
  23. /* MD4Init(MD4_CTX *)
  24. ** Initialize the MD4_CTX prepatory to doing a message digest
  25. ** computation.
  26. */
  27. extern void MD4Init __P((MD4_CTX *MD));
  28. /* MD4Update(MD,X,count)
  29. ** Input: X -- a pointer to an array of unsigned characters.
  30. ** count -- the number of bits of X to use (an unsigned int).
  31. ** Updates MD using the first "count" bits of X.
  32. ** The array pointed to by X is not modified.
  33. ** If count is not a multiple of 8, MD4Update uses high bits of
  34. ** last byte.
  35. ** This is the basic input routine for a user.
  36. ** The routine terminates the MD computation when count < 512, so
  37. ** every MD computation should end with one call to MD4Update with a
  38. ** count less than 512. Zero is OK for a count.
  39. */
  40. extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count));
  41. /* MD4Print(MD)
  42. ** Prints message digest buffer MD as 32 hexadecimal digits.
  43. ** Order is from low-order byte of buffer[0] to high-order byte
  44. ** of buffer[3].
  45. ** Each byte is printed with high-order hexadecimal digit first.
  46. */
  47. extern void MD4Print __P((MD4_CTX *));
  48. /* MD4Final(buf, MD)
  49. ** Returns message digest from MD and terminates the message
  50. ** digest computation.
  51. */
  52. extern void MD4Final __P((unsigned char *, MD4_CTX *));
  53. /*
  54. ** End of md4.h
  55. ****************************(cut)***********************************/