pub struct ProverTranscript<Challenger> { /* private fields */ }
Expand description
Prover transcript over some Challenger that writes to the internal tape and CanSample<F: TowerField>
A Transcript is an abstraction over Fiat-Shamir so the prover and verifier can send and receive data.
Implementations§
Source§impl<Challenger_: Default + Challenger> ProverTranscript<Challenger_>
impl<Challenger_: Default + Challenger> ProverTranscript<Challenger_>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new prover transcript.
By default debug assertions are set to the feature flag debug_assertions
. You may also
change the debug flag with Self::set_debug
.
pub fn into_verifier(self) -> VerifierTranscript<Challenger_>
Source§impl<Challenger_: Challenger> ProverTranscript<Challenger_>
impl<Challenger_: Challenger> ProverTranscript<Challenger_>
pub fn finalize(self) -> Vec<u8> ⓘ
Sourcepub fn set_debug(&mut self, debug: bool)
pub fn set_debug(&mut self, debug: bool)
Sets the debug flag.
This flag is used to enable debug assertions in the TranscriptReader
and
TranscriptWriter
methods.
Sourcepub fn observe<'a, 'b>(&'a mut self) -> TranscriptWriter<'b, impl BufMut + 'b>where
'a: 'b,
pub fn observe<'a, 'b>(&'a mut self) -> TranscriptWriter<'b, impl BufMut + 'b>where
'a: 'b,
Returns a writeable buffer that only observes the data written, without writing it to the proof tape.
This method should be used to observe the input statement.
Sourcepub fn decommitment(&mut self) -> TranscriptWriter<'_, impl BufMut>
pub fn decommitment(&mut self) -> TranscriptWriter<'_, impl BufMut>
Returns a writeable buffer that only writes the data to the proof tape, without observing it.
This method should only be used to write openings of commitments that were already written
to the transcript as an observed message. For example, in the FRI protocol, the prover sends
a Merkle tree root as a commitment, and later sends leaf openings. The leaf openings should
be written using Self::decommitment
because they are verified with respect to the
previously sent Merkle root.
Sourcepub fn message<'a, 'b>(&'a mut self) -> TranscriptWriter<'b, impl BufMut>where
'a: 'b,
pub fn message<'a, 'b>(&'a mut self) -> TranscriptWriter<'b, impl BufMut>where
'a: 'b,
Returns a writeable buffer that observes the data written and writes it to the proof tape.
This method should be used by default to write prover messages in an interactive protocol.
Trait Implementations§
Source§impl<F, Challenger_> CanSample<F> for ProverTranscript<Challenger_>where
F: TowerField,
Challenger_: Challenger,
impl<F, Challenger_> CanSample<F> for ProverTranscript<Challenger_>where
F: TowerField,
Challenger_: Challenger,
Source§impl<Challenger_> CanSampleBits<usize> for ProverTranscript<Challenger_>where
Challenger_: Challenger,
impl<Challenger_> CanSampleBits<usize> for ProverTranscript<Challenger_>where
Challenger_: Challenger,
fn sample_bits(&mut self, bits: usize) -> usize
Source§impl<Challenger: Debug> Debug for ProverTranscript<Challenger>
impl<Challenger: Debug> Debug for ProverTranscript<Challenger>
Source§impl<Challenger_: Default + Challenger> Default for ProverTranscript<Challenger_>
impl<Challenger_: Default + Challenger> Default for ProverTranscript<Challenger_>
Auto Trait Implementations§
impl<Challenger> Freeze for ProverTranscript<Challenger>where
Challenger: Freeze,
impl<Challenger> RefUnwindSafe for ProverTranscript<Challenger>where
Challenger: RefUnwindSafe,
impl<Challenger> Send for ProverTranscript<Challenger>where
Challenger: Send,
impl<Challenger> Sync for ProverTranscript<Challenger>where
Challenger: Sync,
impl<Challenger> Unpin for ProverTranscript<Challenger>where
Challenger: Unpin,
impl<Challenger> UnwindSafe for ProverTranscript<Challenger>where
Challenger: 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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