pub trait MerkleIPVerifierChannel<F: Field>: WordIPVerifierChannel<F> {
type Commitment: Clone;
// Required methods
fn recv_merkle_commitment(
&mut self,
leaf_size: usize,
depth: usize,
) -> Result<Self::Commitment, Error>;
fn recv_openings(
&mut self,
commitment: &Self::Commitment,
indices: &[Self::Word],
) -> Result<Vec<Self::Elem>, Error>;
fn recv_committed_vector(
&mut self,
commitment: &Self::Commitment,
) -> Result<Vec<Self::Elem>, Error>;
}Expand description
An extension of WordIPVerifierChannel that can receive and open Merkle commitments.
Query indices are Self::Words, since a protocol samples them
with WordIPVerifierChannel::sample_bits and a channel that builds a circuit carries them as
wires.
Required Associated Types§
Sourcetype Commitment: Clone
type Commitment: Clone
A Merkle commitment.
Required Methods§
Sourcefn recv_merkle_commitment(
&mut self,
leaf_size: usize,
depth: usize,
) -> Result<Self::Commitment, Error>
fn recv_merkle_commitment( &mut self, leaf_size: usize, depth: usize, ) -> Result<Self::Commitment, Error>
Receives a Merkle commitment for a tree with the given depth and leaf size.
The leaves of the Merkle tree each contain exactly leaf_size field elements.
Sourcefn recv_openings(
&mut self,
commitment: &Self::Commitment,
indices: &[Self::Word],
) -> Result<Vec<Self::Elem>, Error>
fn recv_openings( &mut self, commitment: &Self::Commitment, indices: &[Self::Word], ) -> Result<Vec<Self::Elem>, Error>
Receives a multi-opening of leaves, bound by a Merkle commitment.
Each commitment is associated with the leaf_size and depth requested when received with
Self::recv_merkle_commitment. All indices must be less than 2^depth.
Returns indices.len() * leaf_size elements, where each chunk of leaf_size
contiguous elements corresponds to one provided index.
Sourcefn recv_committed_vector(
&mut self,
commitment: &Self::Commitment,
) -> Result<Vec<Self::Elem>, Error>
fn recv_committed_vector( &mut self, commitment: &Self::Commitment, ) -> Result<Vec<Self::Elem>, Error>
Receives the full committed vector, bound by a Merkle commitment.
Returns leaf_size << depth elements, in leaf order.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".