]> mj.ucw.cz Git - libucw.git/blob - lib/md5.h
29b61f4db9b998a8a0e60e0dc90b32b3600bf1fc
[libucw.git] / lib / md5.h
1 /*
2  *      UCW Library -- MD5 Message Digest
3  *
4  *      This file is in public domain (see lib/md5.c).
5  */
6
7 #ifndef _UCW_MD5_H
8 #define _UCW_MD5_H
9
10 typedef struct {
11         u32 buf[4];
12         u32 bits[2];
13         byte in[64];
14 } md5_context;
15
16 void md5_init(md5_context *context);
17 void md5_update(md5_context *context, const byte *buf, uns len);
18 /* The data are stored inside the context */
19 byte *md5_final(md5_context *context);
20
21 void md5_transform(u32 buf[4], const u32 in[16]);
22
23 /* One-shot interface */
24 void md5_hash_buffer(byte *outbuf, const byte *buffer, uns length);
25
26 #define MD5_HEX_SIZE 33
27 #define MD5_SIZE 16
28
29 #endif /* !_UCW_MD5_H */