Struct flexible_transcript::MerlinTranscript

source ·
pub struct MerlinTranscript(/* private fields */);
Available on crate feature merlin only.
Expand description

A wrapper around a Merlin transcript which satisfiees the Transcript API.

Challenges are fixed to 64 bytes, despite Merlin supporting variable length challenges.

This implementation is intended to remain in the spirit of Merlin more than it’s intended to be in the spirit of the provided DigestTranscript. While DigestTranscript uses flags for each of its different field types, the domain_separate function simply appends a message with a label of “dom-sep”, Merlin’s preferred domain separation label. Since this could introduce transcript conflicts between a domain separation and a message with a label of “dom-sep”, the append_message function uses an assertion to prevent such labels.

Trait Implementations§

source§

impl Clone for MerlinTranscript

source§

fn clone(&self) -> MerlinTranscript

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MerlinTranscript

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Transcript for MerlinTranscript

§

type Challenge = [u8; 64]

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. Read more
source§

fn rng_seed(&mut self, label: &'static [u8]) -> [u8; 32]

Produce a RNG seed. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.