269
|
1 #ifndef XS_MD5_H
|
|
2 #define XS_MD5_H
|
|
3
|
|
4 #include <glib.h>
|
|
5
|
|
6 #ifdef __cplusplus
|
|
7 extern "C" {
|
|
8 #endif
|
|
9
|
|
10 /*
|
|
11 * Typedefs
|
|
12 */
|
|
13 typedef struct md5_state_s {
|
|
14 guint32 count[2]; /* message length in bits, lsw first */
|
|
15 guint32 abcd[4]; /* digest buffer */
|
|
16 guint8 buf[64]; /* accumulate block */
|
|
17 } t_xs_md5state;
|
|
18
|
|
19 #define XS_MD5HASH_LENGTH (16)
|
|
20 #define XS_MD5HASH_LENGTH_CH (XS_MD5HASH_LENGTH * 2)
|
|
21
|
|
22 typedef guint8 t_xs_md5hash[XS_MD5HASH_LENGTH];
|
|
23
|
|
24
|
|
25 /*
|
|
26 * Functions
|
|
27 */
|
|
28 void xs_md5_init(t_xs_md5state *pms);
|
|
29 void xs_md5_append(t_xs_md5state *pms, const guint8 *data, int nbytes);
|
|
30 void xs_md5_finish(t_xs_md5state *pms, t_xs_md5hash digest);
|
|
31
|
|
32
|
|
33 #ifdef __cplusplus
|
|
34 }
|
|
35 #endif
|
|
36 #endif /* XS_MD5_H */
|