1#ifndef SHA256_BLOCK_SHA256_H
2#define SHA256_BLOCK_SHA256_H
3
4#define blk_SHA256_BLKSIZE 64
5
6struct blk_SHA256_CTX {
7 uint32_t state[8];
8 uint64_t size;
9 uint32_t offset;
10 uint8_t buf[blk_SHA256_BLKSIZE];
11};
12
13typedef struct blk_SHA256_CTX blk_SHA256_CTX;
14
15void blk_SHA256_Init(blk_SHA256_CTX *ctx);
16void blk_SHA256_Update(blk_SHA256_CTX *ctx, const void *data, size_t len);
17void blk_SHA256_Final(unsigned char *digest, blk_SHA256_CTX *ctx);
18
19#define platform_SHA256_CTX blk_SHA256_CTX
20#define platform_SHA256_Init blk_SHA256_Init
21#define platform_SHA256_Update blk_SHA256_Update
22#define platform_SHA256_Final blk_SHA256_Final
23
24#endif