4#ifndef PROTOCORE_MLKEM_H
5#define PROTOCORE_MLKEM_H
52#define MLKEM768_EK_BYTES 1184
53#define MLKEM768_DK_BYTES 2400
54#define MLKEM768_CT_BYTES 1088
55#define MLKEM768_SS_BYTES 32
56#define MLKEM768_MSG_BYTES 32
57#define MLKEM768_D_BYTES 32
58#define MLKEM768_Z_BYTES 32
63 proto_bool (*keygen)(uint8_t *,
const uint8_t *,
const uint8_t *, uint8_t *, uint8_t *);
64 proto_bool (*encaps)(uint8_t *,
const uint8_t *,
const uint8_t *, uint8_t *, uint8_t *);
65 proto_bool (*decaps)(uint8_t *,
const uint8_t *,
const uint8_t *, uint8_t *);
proto_bool protocore_ml_kem_keygen(uint8_t *work, const uint8_t *d, const uint8_t *z, uint8_t *ek, uint8_t *dk)
(ek, dk) from the two seeds, deterministic given them.
proto_bool protocore_ml_kem_encaps(uint8_t *work, const uint8_t *ek, const uint8_t *m, uint8_t *ct, uint8_t *ss)
(ct, ss) from a peer key and a message.
PROTOCORE_NS MlKemNs MlKem PROTOCORE_UNUSED
Module namespace.
proto_bool protocore_ml_kem_decaps(uint8_t *work, const uint8_t *dk, const uint8_t *ct, uint8_t *ss)
The shared secret from a ciphertext, through the FO transform.
#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(* keygen)(uint8_t *, const uint8_t *, const uint8_t *, uint8_t *, 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