Skip to main content

Module kem

Module kem 

Source
Expand description

KemPlugin trait — the Rust-side counterpart of the KEM v0 wire protocol.

The KEM interface has two object types: an encapsulator (sender, holds the recipient’s public key) and a decapsulator (recipient, holds the recipient’s secret key). A single plugin implements both, plus keypair generation and a shared-secret size query.

Plugin authors implement this trait on a state type, then apply #[plugin_interface(name = "kem", version = 0)] to the impl block.

See crates/confium-core/src/ffi/kem.rs for the loader-side wire types.

Structs§

KemEncapsulateResult
Result of encapsulation: the ciphertext to send and the shared secret.
KemKeypair
Result of keypair generation.

Traits§

KemPlugin
Trait implemented by KEM plugins. The type Self serves as both the encapsulator and decapsulator state — the plugin dispatches internally based on which entry points are called.