chiark / gitweb /
libudev: do not use any udev source file
[elogind.git] / extras / volume_id / lib / md5.h
1 /* 
2  * MD5 Message Digest Algorithm (RFC1321).
3  *
4  * Derived from cryptoapi implementation, originally based on the
5  * public domain implementation written by Colin Plumb in 1993.
6  *
7  * Copyright (c) Cryptoapi developers.
8  * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
9  * 
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU General Public License as published by the Free
12  * Software Foundation; either version 2 of the License, or (at your option) 
13  * any later version.
14  *
15  */
16
17 #define MD5_DIGEST_SIZE         16
18 #define MD5_HMAC_BLOCK_SIZE     64
19 #define MD5_BLOCK_WORDS         16
20 #define MD5_HASH_WORDS          4
21
22 struct md5_ctx {
23         uint32_t hash[MD5_HASH_WORDS];
24         uint32_t block[MD5_BLOCK_WORDS];
25         uint64_t byte_count;
26 };
27
28 extern void md5_init(struct md5_ctx *mctx);
29 extern void md5_update(struct md5_ctx *mctx, const uint8_t *data, unsigned int len);
30 extern void md5_final(struct md5_ctx *mctx, uint8_t *out);