AutoTranscript

Trait AutoTranscript 

Source
pub trait AutoTranscript: Transcript + Sized {
    type Label: AsRef<[u8]>;

    // Required methods
    fn get_current_label(&self) -> Self::Label;
    fn next_label(&mut self) -> Self::Label;
    fn append<S: AsRef<[u8]>>(&mut self, message: &S);
    fn append_many<S: AsRef<[u8]>>(&mut self, values: &[S]);

    // Provided methods
    fn new(protocol_info: &'static ProtocolInfo, session_id: &SessionId) -> Self { ... }
    fn extract(&mut self, label: &'static [u8]) -> Seed { ... }
    fn derive_rng(&mut self, label: &'static [u8]) -> Self::Rng { ... }
}
Expand description

A trait for transcripts that do not use labels when appending messages. WARNING! This should only be implemented by transcripts that are designed to automatically manage the labels internally at runtime.

Required Associated Types§

Source

type Label: AsRef<[u8]>

The type of the label used for messages in this transcript.

Required Methods§

Source

fn get_current_label(&self) -> Self::Label

Get the label that was used for the last appended message. If no messages have been appended yet, returns the initial label.

Source

fn next_label(&mut self) -> Self::Label

Get the label that will be used for the next appended message.

Source

fn append<S: AsRef<[u8]>>(&mut self, message: &S)

Append a message to the transcript with an automatically generated label.

Source

fn append_many<S: AsRef<[u8]>>(&mut self, values: &[S])

Append multiple messages to the transcript with a common automatically generated label.

Provided Methods§

Source

fn new(protocol_info: &'static ProtocolInfo, session_id: &SessionId) -> Self

Create a new transcript for a specific protocol with a session ID for domain separation.

Source

fn extract(&mut self, label: &'static [u8]) -> Seed

Extract pseudorandom bytes based on the transcript state. Note: two consecutive extractions must yield different outputs.

Source

fn derive_rng(&mut self, label: &'static [u8]) -> Self::Rng

Derive a CSPRNG from the transcript state with a specific label. Allows arbitrary-length output generation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§