Trait flexible_transcript::Transcript
source · 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.
Object Safety§
This trait is not object safe.
Implementors§
source§impl Transcript for MerlinTranscript
Available on crate feature merlin
only.
impl Transcript for MerlinTranscript
Available on crate feature
merlin
only.