Go Back

0 /*

1 * This sha256 implementation is in the public domain

2 * and is provided AS IS, with NO WARRANTY.

3 */

4 #ifndef SHA256_H

5 #define SHA256_H

6

7 typedef struct {

8 unsigned char data[64];

9 unsigned int datalen;

10 unsigned long long bitlen;

11 unsigned int state[8];

12 } sha256_ctx;

13

14 void sha256_init(sha256_ctx *ctx);

15 void sha256_update(sha256_ctx *ctx, unsigned char* data, unsigned len);

16 void sha256_final(sha256_ctx *ctx, unsigned char* hash);

17 int sha256_file(char* path, unsigned char* buf);

18

19 #endif

20