blob: 75317f76c6f553621862073ed8d5a21dc29e1f32 [file] [log] [blame]
Jens Axboe7c353ce2009-08-09 22:40:33 +02001#ifndef FIO_SHA1
2#define FIO_SHA1
3
4/*
5 * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.h),
6 * optimized to do word accesses rather than byte accesses,
7 * and to avoid unnecessary copies into the context array.
8 */
9
Jens Axboe25dfa842012-02-29 10:01:34 +010010struct fio_sha1_ctx {
Jens Axboe7c353ce2009-08-09 22:40:33 +020011 uint32_t *H;
12 unsigned int W[16];
13 unsigned long long size;
14};
15
Jens Axboe25dfa842012-02-29 10:01:34 +010016void fio_sha1_init(struct fio_sha1_ctx *);
17void fio_sha1_update(struct fio_sha1_ctx *, const void *dataIn, unsigned long len);
Jens Axboe159619b2015-01-16 14:25:15 -070018void fio_sha1_final(struct fio_sha1_ctx *);
Jens Axboe7c353ce2009-08-09 22:40:33 +020019
20#endif