blob: 80ee0ab3a5fb092d0f0d8f16b4e6a1d369ae5ab3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#ifndef SHA256_H
#define SHA256_H
#include <stddef.h>
#include <stdint.h>
typedef struct {
uint8_t data[64];
uint32_t datalen;
uint32_t bitlen[2];
uint32_t state[8];
} sha256_ctx;
static void sha256_init(sha256_ctx *ctx);
static void sha256_transform(sha256_ctx *ctx, uint8_t *data);
static void sha256_update(sha256_ctx *ctx, uint8_t *data, uint32_t len);
static void sha256_final(uint8_t *hash, sha256_ctx *ctx);
extern void sha256_hash(char *hash, const char *data, size_t len);
#endif
|