mdigest.h 849 B

123456789101112131415161718192021222324252627
  1. /* The include file for both the MD4 and MD5 routines. */
  2. #define MD4_DIGEST_LEN 16
  3. #define MD5_DIGEST_LEN 16
  4. #define MAX_DIGEST_LEN MD5_DIGEST_LEN
  5. #define CSUM_CHUNK 64
  6. typedef struct {
  7. uint32 A, B, C, D;
  8. uint32 totalN; /* bit count, lower 32 bits */
  9. uint32 totalN2; /* bit count, upper 32 bits */
  10. uchar buffer[CSUM_CHUNK];
  11. } md_context;
  12. void mdfour_begin(md_context *md);
  13. void mdfour_update(md_context *md, const uchar *in, uint32 length);
  14. void mdfour_result(md_context *md, uchar digest[MD4_DIGEST_LEN]);
  15. void get_mdfour(uchar digest[MD4_DIGEST_LEN], const uchar *in, int length);
  16. void md5_begin(md_context *ctx);
  17. void md5_update(md_context *ctx, const uchar *input, uint32 length);
  18. void md5_result(md_context *ctx, uchar digest[MD5_DIGEST_LEN]);
  19. void get_md5(uchar digest[MD5_DIGEST_LEN], const uchar *input, int n);