4#ifndef PROTOCORE_CHACHA20_H
5#define PROTOCORE_CHACHA20_H
40#define PROTOCORE_CHACHA20_KEY_LEN 32
43#define PROTOCORE_CHACHA20_BLOCK_LEN 64
48 proto_bool (*xor_)(uint8_t *,
const uint8_t *,
const uint8_t *, uint64_t,
const uint8_t *, uint8_t *, size_t);
49 proto_bool (*block_ietf)(uint8_t *,
const uint8_t *, uint32_t,
const uint8_t *, uint8_t *);
65 const uint8_t *in, uint8_t *out,
size_t len);
PROTOCORE_NS Chacha20Ns Chacha20 PROTOCORE_UNUSED
Module namespace.
proto_bool protocore_chacha20_xor_(uint8_t *work, const uint8_t *key, const uint8_t *iv, uint64_t counter, const uint8_t *in, uint8_t *out, size_t len)
XOR the OpenSSH-layout keystream over in into out.
proto_bool protocore_chacha20_block_ietf(uint8_t *work, const uint8_t *key, uint32_t counter, const uint8_t *nonce, uint8_t *out)
One 64-byte keystream block in the RFC 8439 layout.
#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.
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* xor_)(uint8_t *, const uint8_t *, const uint8_t *, uint64_t, const uint8_t *, uint8_t *, size_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