pub struct TranscriptGuard<'a, F: Field, S: Duplex<F>, P> { /* private fields */ }Expand description
Wraps transcript and proof, ensuring no message circumvents the transcript.
Implementations§
Source§impl<'a, F: Field, S: Duplex<F>, P> TranscriptGuard<'a, F, S, P>
impl<'a, F: Field, S: Duplex<F>, P> TranscriptGuard<'a, F, S, P>
Sourcepub fn print_state(&self)
pub fn print_state(&self)
Prints the current state of the sponge, for debugging.
pub fn new(transcript: &'a mut Transcript<F, S>, proof: P) -> Self
pub fn new_guard<P2>( &mut self, proof: impl Into<MessageGuard<P2>>, ) -> TranscriptGuard<'_, F, S, P2>
Sourcepub fn receive_message<M, Q, const N: usize>(
&mut self,
query: Q,
) -> Result<(M, [F; N]), Error>
pub fn receive_message<M, Q, const N: usize>( &mut self, query: Q, ) -> Result<(M, [F; N]), Error>
Allows to extract messages from the proof, absorbing them in the transcript automatically, also returning the corresponding challenges.
Sourcepub fn receive_message_delayed<M, Q>(&mut self, query: Q) -> MessageGuard<M>
pub fn receive_message_delayed<M, Q>(&mut self, query: Q) -> MessageGuard<M>
similar to receive_message, doesn’t interact with the sponge in any way and returns a guarded value to be unwrapped later.
Sourcepub fn unwrap_guard<I: Message<F> + 'static, const N: usize>(
&mut self,
instance: MessageGuard<I>,
) -> Result<(I, [F; N]), Error>
pub fn unwrap_guard<I: Message<F> + 'static, const N: usize>( &mut self, instance: MessageGuard<I>, ) -> Result<(I, [F; N]), Error>
unwraps the instance while absorbing it and also returning challenges.
Sourcepub fn unwrap_instance_unsafe<I>(&mut self, instance: MessageGuard<I>) -> I
pub fn unwrap_instance_unsafe<I>(&mut self, instance: MessageGuard<I>) -> I
Unwraps the instance while ignoring the transcript, caller must ensure that not including the instance is acceptable. Will still ultimately fail if the instance was expected in the pattern.
Auto Trait Implementations§
impl<'a, F, S, P> Freeze for TranscriptGuard<'a, F, S, P>where
P: Freeze,
impl<'a, F, S, P> RefUnwindSafe for TranscriptGuard<'a, F, S, P>
impl<'a, F, S, P> Send for TranscriptGuard<'a, F, S, P>
impl<'a, F, S, P> Sync for TranscriptGuard<'a, F, S, P>
impl<'a, F, S, P> Unpin for TranscriptGuard<'a, F, S, P>where
P: Unpin,
impl<'a, F, S, P> UnsafeUnpin for TranscriptGuard<'a, F, S, P>where
P: UnsafeUnpin,
impl<'a, F, S, P> !UnwindSafe for TranscriptGuard<'a, F, S, P>
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
Mutably borrows from an owned value. Read more