Skip to main content

SessionImpl

Trait SessionImpl 

Source
pub trait SessionImpl: Send {
    // Required methods
    fn round(&mut self, incoming: &[Message]) -> Result<RoundResult, Error>;
    fn result(&self) -> Result<Vec<u8>, Error>;
    fn destroy(&mut self);
}
Expand description

Per-session scheme state, driven round-by-round by the framework.

A SessionImpl is not Sync — it owns mutable protocol state for exactly one party’s view of one session. The framework moves it between threads via the owning crate::session::Session handle.

Required Methods§

Source

fn round(&mut self, incoming: &[Message]) -> Result<RoundResult, Error>

Advance one round. Consumes the messages received since the last round and returns the messages to send next, plus a complete flag indicating the session has produced its output and no more rounds are needed.

Source

fn result(&self) -> Result<Vec<u8>, Error>

Extract the final cryptographic artifact (signature bytes, DKG output, KEM shared secret, …). Only valid once a round returned complete == true.

Source

fn destroy(&mut self)

Release any scheme-owned resources. Called exactly once when the framework drops the session. Implementations should zeroize sensitive state.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§