md5.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* MD5.H - header file for MD5C.C
  2. */
  3. /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
  4. rights reserved.
  5. License to copy and use this software is granted provided that it
  6. is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  7. Algorithm" in all material mentioning or referencing this software
  8. or this function.
  9. License is also granted to make and use derivative works provided
  10. that such works are identified as "derived from the RSA Data
  11. Security, Inc. MD5 Message-Digest Algorithm" in all material
  12. mentioning or referencing the derived work.
  13. RSA Data Security, Inc. makes no representations concerning either
  14. the merchantability of this software or the suitability of this
  15. software for any particular purpose. It is provided "as is"
  16. without express or implied warranty of any kind.
  17. These notices must be retained in any copies of any part of this
  18. documentation and/or software.
  19. */
  20. #ifndef _MD5_H_
  21. #define _MD5_H_ 1
  22. #include <stdint.h>
  23. #include <unistd.h>
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #ifndef UINT4
  28. #define UINT4 unsigned int
  29. #endif
  30. #ifndef POINTER
  31. #define POINTER unsigned char *
  32. #endif
  33. /* MD5 context. */
  34. typedef struct {
  35. UINT4 state[4]; /* state (ABCD) */
  36. UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
  37. unsigned char buffer[64]; /* input buffer */
  38. } MD5_CTX;
  39. void MD5_Init (MD5_CTX *context);
  40. void MD5_Update (MD5_CTX * context, unsigned char * input, unsigned int inputLen);
  41. void MD5_Final (unsigned char digest[16], MD5_CTX *context);
  42. unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif /* _MD5_H_ */