==> include/sha256_stream.h <==1/* @ajax/sha256-stream: SHA-256 over a stream of bytes (init, update, final), on
2 * @ajax/sha256-compress. Freestanding. */
3#ifndef SHA256_STREAM_H
4#define SHA256_STREAM_H
5#include <stddef.h>
6#include <stdint.h>
7typedef struct {
8 uint32_t h[8];
9 uint64_t bytes;
10 uint8_t block[64];
11 size_t used;
12} sha256_stream;
13void sha256_stream_init(sha256_stream *s);
14void sha256_stream_update(sha256_stream *s, const void *data, size_t n);
15void sha256_stream_final(sha256_stream *s, uint8_t out[32]);
16/* The digest as 64 lowercase hex digits and a NUL. */
17void sha256_stream_hex(const uint8_t digest[32], char out[65]);
18#endif