+ struct io_u *io_u, unsigned char header_num)
+{
+ return io_u->buf + header_num * hdr->len + hdr_size(hdr);
+}
+
+static int verify_io_u_meta(struct verify_header *hdr, struct thread_data *td,
+ struct io_u *io_u, unsigned int header_num)
+{
+ struct vhdr_meta *vh = hdr_priv(hdr);
+
+ dprint(FD_VERIFY, "meta verify io_u %p, len %u\n", io_u, hdr->len);
+
+ if (vh->offset != io_u->offset + header_num * td->o.verify_interval) {
+ log_err("meta: verify failed at %llu/%u\n",
+ io_u->offset + header_num * hdr->len, hdr->len);
+ return EILSEQ;
+ }
+
+ return 0;
+}
+
+static int verify_io_u_sha512(struct verify_header *hdr, struct io_u *io_u,
+ unsigned int header_num)
+{
+ void *p = io_u_verify_off(hdr, io_u, header_num);
+ struct vhdr_sha512 *vh = hdr_priv(hdr);
+ uint8_t sha512[128];
+ struct sha512_ctx sha512_ctx = {
+ .buf = sha512,
+ };
+
+ dprint(FD_VERIFY, "sha512 verify io_u %p, len %u\n", io_u, hdr->len);
+
+ sha512_init(&sha512_ctx);
+ sha512_update(&sha512_ctx, p, hdr->len - hdr_size(hdr));
+
+ if (memcmp(vh->sha512, sha512_ctx.buf, sizeof(sha512))) {
+ log_err("sha512: verify failed at %llu/%u\n",
+ io_u->offset + header_num * hdr->len, hdr->len);
+ hexdump(vh->sha512, sizeof(vh->sha512));
+ hexdump(sha512_ctx.buf, sizeof(sha512));
+ return EILSEQ;
+ }
+
+ return 0;
+}
+
+static int verify_io_u_sha256(struct verify_header *hdr, struct io_u *io_u,
+ unsigned int header_num)
+{
+ void *p = io_u_verify_off(hdr, io_u, header_num);
+ struct vhdr_sha256 *vh = hdr_priv(hdr);
+ uint8_t sha256[64];
+ struct sha256_ctx sha256_ctx = {
+ .buf = sha256,
+ };
+
+ dprint(FD_VERIFY, "sha256 verify io_u %p, len %u\n", io_u, hdr->len);
+
+ sha256_init(&sha256_ctx);
+ sha256_update(&sha256_ctx, p, hdr->len - hdr_size(hdr));
+
+ if (memcmp(vh->sha256, sha256_ctx.buf, sizeof(sha256))) {
+ log_err("sha256: verify failed at %llu/%u\n",
+ io_u->offset + header_num * hdr->len, hdr->len);
+ hexdump(vh->sha256, sizeof(vh->sha256));
+ hexdump(sha256_ctx.buf, sizeof(sha256));
+ return EILSEQ;
+ }
+
+ return 0;
+}
+
+static int verify_io_u_sha1(struct verify_header *hdr, struct io_u *io_u,
+ unsigned int header_num)