Skip to main content

ActiveSession

Trait ActiveSession 

Source
pub trait ActiveSession {
    // Required methods
    fn seal(&self, bytes: &[u8]) -> Option<Vec<u8>>;
    fn open(&self, bytes: &[u8]) -> Option<Vec<u8>>;
}
Expand description

A keyed, stateful crypto session installed for the live send/receive path. Unlike the stateless Suite registry, a session carries per-direction key/pad material and may fail closed on seal — a one-time pad can run out. Both the keyed PqSuite and the super::pnp one-time pad plug in here, so seal_active_checked / open_active stay suite-agnostic.

Required Methods§

Source

fn seal(&self, bytes: &[u8]) -> Option<Vec<u8>>

Seal outbound bytes, or None to fail closed — the caller must then refuse to send, never transmit the plaintext instead.

Source

fn open(&self, bytes: &[u8]) -> Option<Vec<u8>>

Open inbound bytes, or None on a tampered / foreign / replayed frame.

Implementors§