Skip to main content

MerkleIPProverChannel

Trait MerkleIPProverChannel 

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

Source

type Commitment

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

Required Methods§

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.

The tree depth is log2(data.len() / leaf_size).

§Preconditions
  • data.len() must be a multiple of leaf_size, and the resulting leaf count must be a power of two.
Source

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

§Preconditions

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

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