blob: b6360336d2f5a0a661627b9d7c0c6b93e19aed9f [file] [log] [blame]
Jens Axboecd14cc12007-07-30 10:59:33 +02001#ifndef FIO_SHA256_H
2#define FIO_SHA256_H
3
Jens Axboe89cce052014-09-23 14:08:21 -06004#define SHA256_DIGEST_SIZE 32
5#define SHA256_BLOCK_SIZE 64
6
Jens Axboe25dfa842012-02-29 10:01:34 +01007struct fio_sha256_ctx {
Jens Axboe89cce052014-09-23 14:08:21 -06008 uint32_t count;
9 uint32_t state[SHA256_DIGEST_SIZE / 4];
Jens Axboecd14cc12007-07-30 10:59:33 +020010 uint8_t *buf;
11};
12
Jens Axboe25dfa842012-02-29 10:01:34 +010013void fio_sha256_init(struct fio_sha256_ctx *);
14void fio_sha256_update(struct fio_sha256_ctx *, const uint8_t *, unsigned int);
Jens Axboe89cce052014-09-23 14:08:21 -060015void fio_sha256_final(struct fio_sha256_ctx *);
Jens Axboecd14cc12007-07-30 10:59:33 +020016
17#endif