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 extract_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§
Required Methods§
Sourcefn get_current_label(&self) -> Self::Label
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.
Sourcefn next_label(&mut self) -> Self::Label
fn next_label(&mut self) -> Self::Label
Get the label that will be used for the next appended message.
Sourcefn append<S: AsRef<[u8]>>(&mut self, message: &S)
fn append<S: AsRef<[u8]>>(&mut self, message: &S)
Append a message to the transcript with an automatically generated label.
Sourcefn append_many<S: AsRef<[u8]>>(&mut self, values: &[S])
fn append_many<S: AsRef<[u8]>>(&mut self, values: &[S])
Append multiple messages to the transcript with a common automatically generated label.
Provided Methods§
Sourcefn new(protocol_info: &'static ProtocolInfo, session_id: &SessionId) -> Self
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.
Sourcefn extract(&mut self, label: &'static [u8]) -> Seed
fn extract(&mut self, label: &'static [u8]) -> Seed
Extract pseudorandom bytes based on the transcript state. Note: two consecutive extractions must yield different outputs.
Sourcefn extract_rng(&mut self, label: &'static [u8]) -> Self::Rng
fn extract_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.