X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=crc%2Fsha256.h;h=b904c7d1d3d031660542565910f024f261fe5f1b;hp=c7aa28fd9f284672af80263fdbf2702c81acac66;hb=04ba61dfa67784d4dfcc22a2b3de7ede28e22e40;hpb=25dfa848abbb6c35b4d45fabd5a8e82cb77fb285 diff --git a/crc/sha256.h b/crc/sha256.h index c7aa28fd..b904c7d1 100644 --- a/crc/sha256.h +++ b/crc/sha256.h @@ -1,13 +1,19 @@ #ifndef FIO_SHA256_H #define FIO_SHA256_H +#include + +#define SHA256_DIGEST_SIZE 32 +#define SHA256_BLOCK_SIZE 64 + struct fio_sha256_ctx { - uint32_t count[2]; - uint32_t state[8]; + uint32_t count; + uint32_t state[SHA256_DIGEST_SIZE / 4]; uint8_t *buf; }; void fio_sha256_init(struct fio_sha256_ctx *); void fio_sha256_update(struct fio_sha256_ctx *, const uint8_t *, unsigned int); +void fio_sha256_final(struct fio_sha256_ctx *); #endif