pub trait MerkleIPProverChannel<F: Field>: WordIPProverChannel<F> {
type Commitment;
// Required methods
fn send_merkle_commitment<P: PackedField<Scalar = F>>(
&mut self,
data: FieldSlice<'_, P>,
leaf_size: usize,
) -> Self::Commitment;
fn send_openings<P: PackedField<Scalar = F>>(
&mut self,
commitment: &Self::Commitment,
data: FieldSlice<'_, P>,
indices: &[Self::Word],
);
fn send_committed_vector<P: PackedField<Scalar = F>>(
&mut self,
commitment: &Self::Commitment,
data: FieldSlice<'_, P>,
);
}Expand description
An extension of WordIPProverChannel that can send and open Merkle commitments.
Query indices are Self::Words, matching the verifier’s
MerkleIPVerifierChannel.
Required Associated Types§
Sourcetype Commitment
type Commitment
A Merkle commitment, carrying the data required to open it later.
Required Methods§
Sourcefn send_merkle_commitment<P: PackedField<Scalar = F>>(
&mut self,
data: FieldSlice<'_, P>,
leaf_size: usize,
) -> Self::Commitment
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.
The tree depth is log2(data.len() / leaf_size).
§Preconditions
data.len()must be a multiple ofleaf_size, and the resulting leaf count must be a power of two.
Sourcefn send_openings<P: PackedField<Scalar = F>>(
&mut self,
commitment: &Self::Commitment,
data: FieldSlice<'_, P>,
indices: &[Self::Word],
)
fn send_openings<P: PackedField<Scalar = F>>( &mut self, commitment: &Self::Commitment, data: FieldSlice<'_, P>, indices: &[Self::Word], )
Sends a multi-opening of committed leaves, bound by a Merkle commitment.
All indices must be less than 2^depth for the commitment’s tree depth. The verifier
receives indices.len() * leaf_size field elements via its matching recv_openings call.
§Preconditions
datamust be the buffer passed toSelf::send_merkle_commitmentfor this commitment.
Sourcefn send_committed_vector<P: PackedField<Scalar = F>>(
&mut self,
commitment: &Self::Commitment,
data: FieldSlice<'_, P>,
)
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.
§Preconditions
datamust be the buffer passed toSelf::send_merkle_commitmentfor this commitment.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".