Speed up md5 hash filling/verifying by 20%
Get rid of the on-stack hash copies, hash directly into the buffer.
We need to 'fix' md5 to just initially clear a/b/c/d in md5_update().
Tested, works, generates same checksums.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/md5.h b/md5.h
index 9d1cf4c..80fbcec 100644
--- a/md5.h
+++ b/md5.h
@@ -17,7 +17,7 @@
(w += f(x, y, z) + in, w = (w<<s | w>>(32-s)) + x)
struct md5_ctx {
- uint32_t hash[MD5_HASH_WORDS];
+ uint32_t *hash;
uint32_t block[MD5_BLOCK_WORDS];
uint64_t byte_count;
};