md4.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Free for all implementation of the MD4 message-digest algorithm
  2. // by Dominik Reichl
  3. // Based on RSA's MD4C.C and MD4.h files.
  4. // Original header in MD4C.C and MD4.h:
  5. // MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm
  6. /*
  7. Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
  8. License to copy and use this software is granted provided that it
  9. is identified as the "RSA Data Security, Inc. MD4 Message-Digest
  10. Algorithm" in all material mentioning or referencing this software
  11. or this function.
  12. License is also granted to make and use derivative works provided
  13. that such works are identified as "derived from the RSA Data
  14. Security, Inc. MD4 Message-Digest Algorithm" in all material
  15. mentioning or referencing the derived work.
  16. RSA Data Security, Inc. makes no representations concerning either
  17. the merchantability of this software or the suitability of this
  18. software for any particular purpose. It is provided "as is"
  19. without express or implied warranty of any kind.
  20. These notices must be retained in any copies of any part of this
  21. documentation and/or software.
  22. */
  23. #ifndef ___MD4_H___
  24. #define ___MD4_H___
  25. #ifndef MD4_POINTER
  26. typedef unsigned char * MD4_POINTER;
  27. #endif
  28. #ifndef UINT4
  29. typedef unsigned long UINT4;
  30. #endif
  31. // MD4 context
  32. typedef struct {
  33. UINT4 state[4]; // state (ABCD)
  34. UINT4 count[2]; // number of bits, modulo 2^64 (lsb first)
  35. unsigned char buffer[64]; // input buffer
  36. } MD4_CTX;
  37. void MD4Init(MD4_CTX *context);
  38. void MD4Update(MD4_CTX *context, unsigned char *input, unsigned int inputLen);
  39. void MD4Final(unsigned char *digest, MD4_CTX *context);
  40. #endif // ___MD4_H___