md5.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef MD5_H
  2. #define MD5_H
  3. #ifndef HEADER_MD5_H
  4. /* Try to avoid clashes with OpenSSL */
  5. #define HEADER_MD5_H
  6. #endif
  7. struct MD5Context {
  8. __u32 buf[4];
  9. __u32 bits[2];
  10. unsigned char in[64];
  11. };
  12. #endif /* !MD5_H */
  13. #ifndef _HMAC_MD5_H
  14. struct HMACMD5Context {
  15. struct MD5Context ctx;
  16. unsigned char k_ipad[65];
  17. unsigned char k_opad[65];
  18. };
  19. #endif /* _HMAC_MD5_H */
  20. void MD5Init(struct MD5Context *context);
  21. void MD5Update(struct MD5Context *context, unsigned char const *buf,
  22. unsigned len);
  23. void MD5Final(unsigned char digest[16], struct MD5Context *context);
  24. /* The following definitions come from lib/hmacmd5.c */
  25. /* void hmac_md5_init_rfc2104(unsigned char *key, int key_len,
  26. struct HMACMD5Context *ctx);*/
  27. void hmac_md5_init_limK_to_64(const unsigned char *key, int key_len,
  28. struct HMACMD5Context *ctx);
  29. void hmac_md5_update(const unsigned char *text, int text_len,
  30. struct HMACMD5Context *ctx);
  31. void hmac_md5_final(unsigned char *digest, struct HMACMD5Context *ctx);
  32. /* void hmac_md5(unsigned char key[16], unsigned char *data, int data_len,
  33. unsigned char *digest);*/