pub trait Transcript: Send + Clone {
type Challenge: Send + Sync + Clone + AsRef<[u8]>;
// Required methods
fn new(name: &'static [u8]) -> Self;
fn domain_separate(&mut self, label: &'static [u8]);
fn append_message<M: AsRef<[u8]>>(
&mut self,
label: &'static [u8],
message: M,
);
fn challenge(&mut self, label: &'static [u8]) -> Self::Challenge;
fn rng_seed(&mut self, label: &'static [u8]) -> [u8; 32];
}
Expand description
A transcript trait valid over a variety of transcript formats.
Required Associated Types§
Required Methods§
Sourcefn domain_separate(&mut self, label: &'static [u8])
fn domain_separate(&mut self, label: &'static [u8])
Apply a domain separator to the transcript.
Sourcefn append_message<M: AsRef<[u8]>>(&mut self, label: &'static [u8], message: M)
fn append_message<M: AsRef<[u8]>>(&mut self, label: &'static [u8], message: M)
Append a message to the transcript.
Sourcefn challenge(&mut self, label: &'static [u8]) -> Self::Challenge
fn challenge(&mut self, label: &'static [u8]) -> Self::Challenge
Produce a challenge.
Implementors MUST update the transcript as it does so, preventing the same challenge from being generated multiple times.
Sourcefn rng_seed(&mut self, label: &'static [u8]) -> [u8; 32]
fn rng_seed(&mut self, label: &'static [u8]) -> [u8; 32]
Produce a RNG seed.
Helper function for parties needing to generate random data from an agreed upon state.
Implementors MAY internally call the challenge function for the needed bytes, and accordingly produce a transcript conflict between two transcripts, one which called challenge(label) and one which called rng_seed(label) at the same point.
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.