Jens Axboe | cd14cc1 | 2007-07-30 10:59:33 +0200 | [diff] [blame] | 1 | #ifndef FIO_SHA256_H |
| 2 | #define FIO_SHA256_H |
| 3 | |
Jens Axboe | 89cce05 | 2014-09-23 14:08:21 -0600 | [diff] [blame] | 4 | #define SHA256_DIGEST_SIZE 32 |
| 5 | #define SHA256_BLOCK_SIZE 64 |
| 6 | |
Jens Axboe | 25dfa84 | 2012-02-29 10:01:34 +0100 | [diff] [blame] | 7 | struct fio_sha256_ctx { |
Jens Axboe | 89cce05 | 2014-09-23 14:08:21 -0600 | [diff] [blame] | 8 | uint32_t count; |
| 9 | uint32_t state[SHA256_DIGEST_SIZE / 4]; |
Jens Axboe | cd14cc1 | 2007-07-30 10:59:33 +0200 | [diff] [blame] | 10 | uint8_t *buf; |
| 11 | }; |
| 12 | |
Jens Axboe | 25dfa84 | 2012-02-29 10:01:34 +0100 | [diff] [blame] | 13 | void fio_sha256_init(struct fio_sha256_ctx *); |
| 14 | void fio_sha256_update(struct fio_sha256_ctx *, const uint8_t *, unsigned int); |
Jens Axboe | 89cce05 | 2014-09-23 14:08:21 -0600 | [diff] [blame] | 15 | void fio_sha256_final(struct fio_sha256_ctx *); |
Jens Axboe | cd14cc1 | 2007-07-30 10:59:33 +0200 | [diff] [blame] | 16 | |
| 17 | #endif |