4#ifndef PROTOCORE_SHA256_H
5#define PROTOCORE_SHA256_H
34#define PROTOCORE_SHA256_DIGEST_LEN 32
37#define PROTOCORE_SHA256_BLOCK_LEN 64
43 proto_bool (*update)(uint8_t *,
const uint8_t *, size_t);
45 proto_bool (*hash)(uint8_t *,
const uint8_t *, size_t, uint8_t *);
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
proto_bool protocore_sha256_update(uint8_t *work, const uint8_t *data, size_t len)
Feed the running digest a chunk.
proto_bool protocore_sha256_init(uint8_t *work)
Start a digest.
PROTOCORE_NS Sha256Ns Sha256 PROTOCORE_UNUSED
Module namespace.
proto_bool protocore_sha256_final(uint8_t *work, uint8_t *out)
Pad, compress the last block, write the 32 bytes out.
proto_bool protocore_sha256_hash(uint8_t *work, const uint8_t *data, size_t len, uint8_t *out)
Init, update and final in one call, for a message already whole.
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* init)(uint8_t *)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS