projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Properly initialize md5 hash seed
[fio.git]
/
md5.c
diff --git
a/md5.c
b/md5.c
index cf1f814a0d63c2cee558c8049140156e90f9723c..8f9adb22ee745e41a8a212654524cefb67e8fd55 100644
(file)
--- a/
md5.c
+++ b/
md5.c
@@
-88,6
+88,14
@@
static void md5_transform(uint32_t *hash, uint32_t const *in)
hash[3] += d;
}
hash[3] += d;
}
+void md5_init(struct md5_ctx *mctx)
+{
+ mctx->hash[0] = 0x67452301;
+ mctx->hash[1] = 0xefcdab89;
+ mctx->hash[2] = 0x98badcfe;
+ mctx->hash[3] = 0x10325476;
+}
+
void md5_update(struct md5_ctx *mctx, const uint8_t *data, unsigned int len)
{
const uint32_t avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f);
void md5_update(struct md5_ctx *mctx, const uint8_t *data, unsigned int len)
{
const uint32_t avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f);