Tweaking the license text a bit more.
[rsync/rsync.git] / lib / mdigest.h
CommitLineData
a0456b9c
WD
1/* The include file for both the MD4 and MD5 routines. */
2
3#define MD4_DIGEST_LEN 16
4#define MD5_DIGEST_LEN 16
5#define MAX_DIGEST_LEN MD5_DIGEST_LEN
6
7#define CSUM_CHUNK 64
8
9typedef struct {
10 uint32 A, B, C, D;
11 uint32 totalN; /* bit count, lower 32 bits */
12 uint32 totalN2; /* bit count, upper 32 bits */
13 uchar buffer[CSUM_CHUNK];
14} md_context;
15
16void mdfour_begin(md_context *md);
17void mdfour_update(md_context *md, const uchar *in, uint32 length);
18void mdfour_result(md_context *md, uchar digest[MD4_DIGEST_LEN]);
19
20void get_mdfour(uchar digest[MD4_DIGEST_LEN], const uchar *in, int length);
21
22void md5_begin(md_context *ctx);
23void md5_update(md_context *ctx, const uchar *input, uint32 length);
24void md5_result(md_context *ctx, uchar digest[MD5_DIGEST_LEN]);
25
26void get_md5(uchar digest[MD5_DIGEST_LEN], const uchar *input, int n);