Skip to main content

TranscriptGuard

Struct TranscriptGuard 

Source
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>

Source

pub fn print_state(&self)

Prints the current state of the sponge, for debugging.

Source

pub fn new(transcript: &'a mut Transcript<F, S>, proof: P) -> Self

Source

pub fn new_guard<P2>( &mut self, proof: impl Into<MessageGuard<P2>>, ) -> TranscriptGuard<'_, F, S, P2>

Source

pub fn receive_message<M, Q, const N: usize>( &mut self, query: Q, ) -> Result<(M, [F; N]), Error>
where M: Message<F> + 'static, Q: Fn(&P) -> M,

Allows to extract messages from the proof, absorbing them in the transcript automatically, also returning the corresponding challenges.

Source

pub fn receive_message_delayed<M, Q>(&mut self, query: Q) -> MessageGuard<M>
where M: 'static, Q: FnOnce(&P) -> M,

similar to receive_message, doesn’t interact with the sponge in any way and returns a guarded value to be unwrapped later.

Source

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.

Source

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.

Source

pub fn point(&mut self) -> Result<Vec<F>, Error>

generates a multivariate point

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>
where P: Send, S: Send,

§

impl<'a, F, S, P> Sync for TranscriptGuard<'a, F, S, P>
where P: Sync, S: Sync,

§

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V