diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-08-31 12:20:24 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-08-31 12:20:24 +0200 |
commit | ac877d7cf46e25bd50d17450e74f3b0346a8d5a1 (patch) | |
tree | 4b6c52c6c9037aed6c8da5df3c3680c61a51f565 /extras/volume_id/lib/md5.h | |
parent | e407720bbaa718d97eefacb62ff96a7796f54281 (diff) |
volume_id: hfs - calculate proper uuid
Diffstat (limited to 'extras/volume_id/lib/md5.h')
-rw-r--r-- | extras/volume_id/lib/md5.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/extras/volume_id/lib/md5.h b/extras/volume_id/lib/md5.h new file mode 100644 index 0000000000..3d7bd39a57 --- /dev/null +++ b/extras/volume_id/lib/md5.h @@ -0,0 +1,30 @@ +/* + * MD5 Message Digest Algorithm (RFC1321). + * + * Derived from cryptoapi implementation, originally based on the + * public domain implementation written by Colin Plumb in 1993. + * + * Copyright (c) Cryptoapi developers. + * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + */ + +#define MD5_DIGEST_SIZE 16 +#define MD5_HMAC_BLOCK_SIZE 64 +#define MD5_BLOCK_WORDS 16 +#define MD5_HASH_WORDS 4 + +struct md5_ctx { + uint32_t hash[MD5_HASH_WORDS]; + uint32_t block[MD5_BLOCK_WORDS]; + uint64_t byte_count; +}; + +extern void md5_init(struct md5_ctx *mctx); +extern void md5_update(struct md5_ctx *mctx, const uint8_t *data, unsigned int len); +extern void md5_final(struct md5_ctx *mctx, uint8_t *out); |