sha256: fix verify failure
After the checksumming update, it's required that we call the
_final() to get consistent checksums between data generation
and data verification. Seems to only affect sha256, but we should
do it for sha1 and md5 too.
Fixes: f99d67f932ab
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/crc/sha1.c b/crc/sha1.c
index 117fbd9..8d64c8e 100644
--- a/crc/sha1.c
+++ b/crc/sha1.c
@@ -55,7 +55,7 @@
memcpy(ctx->W, data, len);
}
-void fio_sha1_final(unsigned char hashout[20], struct fio_sha1_ctx *ctx)
+void fio_sha1_final(struct fio_sha1_ctx *ctx)
{
static const unsigned char pad[64] = { 0x80 };
unsigned int padlen[2];
@@ -69,11 +69,6 @@
i = ctx->size & 63;
fio_sha1_update(ctx, pad, 1+ (63 & (55 - i)));
fio_sha1_update(ctx, padlen, 8);
-
- /* Output hash
- */
- for (i = 0; i < 5; i++)
- ((unsigned int *)hashout)[i] = htonl(ctx->H[i]);
}
#if defined(__i386__) || defined(__x86_64__)