Transcript

Trait 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§

Source

fn new(name: &'static [u8]) -> Self

Create a new transcript with the specified name.

Source

fn domain_separate(&mut self, label: &'static [u8])

Apply a domain separator to the transcript.

Source

fn append_message<M: AsRef<[u8]>>(&mut self, label: &'static [u8], message: M)

Append a message to the transcript.

Source

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.

Source

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.

Implementors§

Source§

impl Transcript for MerlinTranscript

Available on crate feature merlin only.
Source§

impl<D: Send + Clone + SecureDigest> Transcript for DigestTranscript<D>

Source§

type Challenge = GenericArray<u8, <D as OutputSizeUser>::OutputSize>