1 /*
2  * This is an OpenSSL-compatible implementation of the RSA Data Security,
3  * Inc. MD5 Message-Digest Algorithm.
4  *
5  * Written by Solar Designer <solar@openwall.com> in 2001, and placed in
6  * the public domain.  See md5.c for more information.
7  */
8 
9 #ifndef MD5_H
10 #define MD5_H
11 
12 #include "hash-method.h"
13 
14 #define	MD5_RESULTLEN (128/8)
15 
16 struct md5_context {
17 	uint_fast32_t lo, hi;
18 	uint_fast32_t a, b, c, d;
19 	unsigned char buffer[64];
20 	uint_fast32_t block[MD5_RESULTLEN];
21 };
22 
23 void md5_init(struct md5_context *ctx);
24 void md5_update(struct md5_context *ctx, const void *data, size_t size);
25 void md5_final(struct md5_context *ctx,
26 	       unsigned char result[STATIC_ARRAY MD5_RESULTLEN]);
27 
28 void md5_get_digest(const void *data, size_t size,
29 		    unsigned char result[STATIC_ARRAY MD5_RESULTLEN]);
30 
31 extern const struct hash_method hash_method_md5;
32 
33 #endif
34