pub struct IOPTranscript<F: PrimeField> { /* private fields */ }
Expand description
An IOP transcript consists of a Merlin transcript and a flag is_empty
to
indicate that if the transcript is empty.
It is associated with a prime field F
for which challenges are generated
over.
The is_empty
flag is useful in the case where a protocol is initiated by
the verifier, in which case the prover should start its phase by receiving a
non-empty
transcript.
Implementations§
Source§impl<F: PrimeField> IOPTranscript<F>
impl<F: PrimeField> IOPTranscript<F>
Sourcepub fn append_message(
&mut self,
label: &'static [u8],
msg: &[u8],
) -> Result<(), TranscriptError>
pub fn append_message( &mut self, label: &'static [u8], msg: &[u8], ) -> Result<(), TranscriptError>
Append the message to the transcript.
Sourcepub fn append_serializable_element<S: CanonicalSerialize>(
&mut self,
label: &'static [u8],
group_elem: &S,
) -> Result<(), TranscriptError>
pub fn append_serializable_element<S: CanonicalSerialize>( &mut self, label: &'static [u8], group_elem: &S, ) -> Result<(), TranscriptError>
Append the message to the transcript.
Sourcepub fn get_and_append_challenge(
&mut self,
label: &'static [u8],
) -> Result<F, TranscriptError>
pub fn get_and_append_challenge( &mut self, label: &'static [u8], ) -> Result<F, TranscriptError>
Generate the challenge from the current transcript and append it to the transcript.
The output field element is statistical uniform as long as the field has a size less than 2^384.
Sourcepub fn get_and_append_byte_challenge(
&mut self,
label: &'static [u8],
dest: &mut [u8],
) -> Result<(), TranscriptError>
pub fn get_and_append_byte_challenge( &mut self, label: &'static [u8], dest: &mut [u8], ) -> Result<(), TranscriptError>
Generate the challenge from the current transcript and append it to the transcript.
Without exposing the internal field transcript
,
this is a wrapper around getting bytes as opposed to field elements.
Trait Implementations§
Source§impl<F: Clone + PrimeField> Clone for IOPTranscript<F>
impl<F: Clone + PrimeField> Clone for IOPTranscript<F>
Source§fn clone(&self) -> IOPTranscript<F>
fn clone(&self) -> IOPTranscript<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<F> Freeze for IOPTranscript<F>
impl<F> RefUnwindSafe for IOPTranscript<F>where
F: RefUnwindSafe,
impl<F> Send for IOPTranscript<F>
impl<F> Sync for IOPTranscript<F>
impl<F> Unpin for IOPTranscript<F>where
F: Unpin,
impl<F> UnwindSafe for IOPTranscript<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more