36#ifndef __NILOREA_SHA256__
37#define __NILOREA_SHA256__
52#define N_SHA256_LEN 32
54#define N_SHA256_HEX_LEN 65
unsigned char block[64]
the block being filled
uint32_t state[8]
the eight working words
size_t used
how much of it is filled
uint64_t length
bytes hashed so far
void n_sha256_final(N_SHA256 *ctx, unsigned char out[32])
finish: the digest, the state left spent
void n_sha256_init(N_SHA256 *ctx)
start a hash
int n_sha256_file(const char *path, unsigned char out[32])
hash a file, read in pieces
void n_sha256(const void *data, size_t len, unsigned char out[32])
hash one buffer
#define N_SHA256_HEX_LEN
size of its lowercase hex form, terminator included
void n_sha256_update(N_SHA256 *ctx, const void *data, size_t len)
feed bytes
#define N_SHA256_LEN
size in bytes of a SHA-256 digest
void n_sha256_hex(const unsigned char digest[32], char out[65])
a digest as lowercase hex
a SHA-256 in progress: plain data, copyable to fork a hash