md5.h 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef MD5_H
  2. #define MD5_H
  3. #ifdef __cplusplus
  4. extern "C"
  5. {
  6. #endif
  7. #include <stdio.h>
  8. #include <stdint.h>
  9. void make_digest(char *md5str, const unsigned char *digest);
  10. void make_digest_ex(char *md5str, const unsigned char *digest, int len);
  11. /*
  12. * This is an OpenSSL-compatible implementation of the RSA Data Security,
  13. * Inc. MD5 Message-Digest Algorithm (RFC 1321).
  14. *
  15. * Written by Solar Designer <solar at openwall.com> in 2001, and placed
  16. * in the public domain. There's absolutely no warranty.
  17. *
  18. * See md5.c for more information.
  19. */
  20. /* MD5 context. */
  21. typedef struct {
  22. uint32_t lo, hi;
  23. uint32_t a, b, c, d;
  24. unsigned char buffer[64];
  25. uint32_t block[16];
  26. } MD5_CTX;
  27. void MD5Init(MD5_CTX *ctx);
  28. void MD5Update(MD5_CTX *ctx, const void *data, size_t size);
  29. void MD5Final(unsigned char *result, MD5_CTX *ctx);
  30. void md5(void *data, size_t data_size, void *hashstr);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif