Skip to main content

ProverMerkleTranscriptChannel

Struct ProverMerkleTranscriptChannel 

Source
pub struct ProverMerkleTranscriptChannel<T, Challenger_, F, H: ParallelHashSuite, A: Allocator = GlobalAllocator> { /* private fields */ }
Expand description

A MerkleIPProverChannel over a ProverTranscript, committing with a BinaryMerkleTreeProver.

The transcript is held through a BorrowMut bound, so the channel can own the transcript or mutably borrow one.

Implementations§

Source§

impl<T, Challenger_, F, H: ParallelHashSuite> ProverMerkleTranscriptChannel<T, Challenger_, F, H>

Source

pub fn new(transcript: T) -> Self

Constructs a channel over the transcript with a default Merkle tree prover.

Source§

impl<T, Challenger_, F, H: ParallelHashSuite, A: Allocator> ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>

Source

pub const fn with_merkle_prover( transcript: T, merkle_prover: BinaryMerkleTreeProver<F, H, A>, ) -> Self

Constructs a channel over the transcript with the given Merkle tree prover.

The prover carries the allocator every committed tree draws its nodes from.

Source

pub fn into_transcript(self) -> T

Returns the wrapped transcript.

Trait Implementations§

Source§

impl<T, Challenger_, F, H: ParallelHashSuite, A: Allocator> GrindingProverChannel for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where T: BorrowMut<ProverTranscript<Challenger_>>, Challenger_: Challenger + Clone,

Source§

fn grind(&mut self, bits: usize) -> u64

Searches for a nonce meeting bits of difficulty and writes it, returning the nonce. Read more
Source§

impl<F, T, Challenger_, H, A> IPProverChannel<F> for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where F: Field, T: BorrowMut<ProverTranscript<Challenger_>>, Challenger_: Challenger, H: ParallelHashSuite, A: Allocator,

Source§

fn send_one(&mut self, elem: F)

Sends a single field element to the verifier.
Source§

fn send_many(&mut self, elems: &[F])

Sends multiple field elements to the verifier.
Source§

fn observe_one(&mut self, val: F)

Observes a single field element, feeding it into the Fiat-Shamir state.
Source§

fn observe_many(&mut self, vals: &[F])

Observes multiple field elements, feeding them into the Fiat-Shamir state.
Source§

fn sample(&mut self) -> F

Samples a random challenge. Read more
Source§

fn send_public_claim(&mut self, elem: F)

Sends a value the verifier could compute for itself, as advice. Read more
Source§

fn sample_many(&mut self, n: usize) -> Vec<F>

Samples n random challenges.
Source§

fn sample_array<const N: usize>(&mut self) -> [F; N]

Samples a fixed-size array of random challenges.
Source§

impl<F, T, Challenger_, H, A> MerkleIPProverChannel<F> for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where F: Field, T: BorrowMut<ProverTranscript<Challenger_>>, Challenger_: Challenger, H: ParallelHashSuite, A: Allocator, Output<H::LeafHash>: SerializeBytes,

Source§

type Commitment = ProverMerkleCommitment<BinaryMerkleTree<Array<u8, <<H as HashSuite>::LeafHash as OutputSizeUser>::OutputSize>, A>>

A Merkle commitment, carrying the data required to open it later.
Source§

fn send_merkle_commitment<P: PackedField<Scalar = F>>( &mut self, data: FieldSlice<'_, P>, leaf_size: usize, ) -> Self::Commitment

Commits data as a Merkle tree with leaves of exactly leaf_size scalars each and sends the commitment. Read more
Source§

fn send_openings<P: PackedField<Scalar = F>>( &mut self, commitment: &Self::Commitment, data: FieldSlice<'_, P>, indices: &[Word], )

Sends a multi-opening of committed leaves, bound by a Merkle commitment. Read more
Source§

fn send_committed_vector<P: PackedField<Scalar = F>>( &mut self, commitment: &Self::Commitment, data: FieldSlice<'_, P>, )

Sends the full committed vector, bound by a Merkle commitment. Read more
Source§

impl<F, T, Challenger_, H, A> WordIPProverChannel<F> for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where F: Field, T: BorrowMut<ProverTranscript<Challenger_>>, Challenger_: Challenger, H: ParallelHashSuite, A: Allocator,

Source§

type Word = Word

The word type this channel carries. Read more
Source§

fn observe_words(&mut self, words: &[Word])

Feeds words into the Fiat-Shamir state, each as eight little-endian bytes.
Source§

fn sample_bits(&mut self, bits: usize) -> Word

Samples a uniform word of the given bit width, matching what the verifier samples. Read more

Auto Trait Implementations§

§

impl<T, Challenger_, F, H, A> Freeze for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where T: Freeze, A: Freeze, <H as HashSuite>::Compression: Freeze,

§

impl<T, Challenger_, F, H, A> RefUnwindSafe for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>

§

impl<T, Challenger_, F, H, A> Send for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where T: Send, A: Send, Challenger_: Send, <H as HashSuite>::Compression: Send,

§

impl<T, Challenger_, F, H, A> Sync for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where T: Sync, Challenger_: Sync, <H as HashSuite>::Compression: Sync,

§

impl<T, Challenger_, F, H, A> Unpin for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where T: Unpin, A: Unpin, Challenger_: Unpin, <H as HashSuite>::Compression: Unpin,

§

impl<T, Challenger_, F, H, A> UnsafeUnpin for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>

§

impl<T, Challenger_, F, H, A> UnwindSafe for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where T: UnwindSafe, A: UnwindSafe, Challenger_: UnwindSafe, <H as HashSuite>::Compression: UnwindSafe,

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more