]>
Commit | Line | Data |
---|---|---|
33b4f40a PT |
1 | /* |
2 | * BIRD Library -- MD5 Hash Function and HMAC-MD5 Function | |
3 | * | |
4 | * (c) 2015 CZ.NIC z.s.p.o. | |
5 | * | |
6 | * Adapted for BIRD by Martin Mares <mj@ucw.cz> | |
7 | * | |
8 | * Can be freely distributed and used under the terms of the GNU GPL. | |
9 | */ | |
18c8241a | 10 | |
33b4f40a PT |
11 | #ifndef _BIRD_MD5_H_ |
12 | #define _BIRD_MD5_H_ | |
13 | ||
14 | #include "nest/bird.h" | |
15 | ||
16 | ||
17 | #define MD5_SIZE 16 | |
18 | #define MD5_HEX_SIZE 33 | |
19 | #define MD5_BLOCK_SIZE 64 | |
20 | ||
21 | ||
de2a27e2 OZ |
22 | struct hash_context; |
23 | ||
33b4f40a PT |
24 | struct md5_context { |
25 | u32 buf[4]; | |
26 | u32 bits[2]; | |
27 | byte in[64]; | |
18c8241a MM |
28 | }; |
29 | ||
33b4f40a | 30 | |
de2a27e2 OZ |
31 | void md5_init(struct hash_context *ctx); |
32 | void md5_update(struct hash_context *ctx, const byte *buf, uint len); | |
33 | byte *md5_final(struct hash_context *ctx); | |
33b4f40a | 34 | |
18c8241a | 35 | |
33b4f40a | 36 | #endif /* _BIRD_MD5_H_ */ |