Skip to main content

IPProverChannel

Trait IPProverChannel 

Source
pub trait IPProverChannel<F: Field> {
    // Required methods
    fn send_one(&mut self, elem: F);
    fn observe_one(&mut self, val: F);
    fn sample(&mut self) -> F;

    // Provided methods
    fn send_many(&mut self, elems: &[F]) { ... }
    fn send_public_claim(&mut self, elem: F) { ... }
    fn observe_many(&mut self, vals: &[F]) { ... }
    fn sample_many(&mut self, n: usize) -> Vec<F> { ... }
    fn sample_array<const N: usize>(&mut self) -> [F; N] { ... }
}
Expand description

Channel for sending prover messages and sampling challenges in a public-coin interactive protocol.

In a public-coin protocol, the prover’s role is to:

  1. Send field elements to the verifier via send_* methods
  2. Sample the same random challenges as the verifier via sample

When used with a Fiat-Shamir transcript, the challenges are derived deterministically from the transcript state, ensuring prover and verifier derive identical challenges.

Required Methods§

Source

fn send_one(&mut self, elem: F)

Sends a single field element 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 sample(&mut self) -> F

Samples a random challenge.

In a Fiat-Shamir transcript, this derives the challenge deterministically from the current transcript state, matching what the verifier will sample.

Provided Methods§

Source

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

Sends multiple field elements to the verifier.

Source

fn send_public_claim(&mut self, elem: F)

Sends a value the verifier could compute for itself, as advice.

The verifier’s counterpart is recv_public_claim, which documents what a claim is. A claim depends on public-channel-derived values alone, so a channel that masks the prover’s messages sends this one in the clear. The default is the plain send, for a channel that draws no such distinction.

Source

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

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

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.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<F, Challenger_> IPProverChannel<F> for ProverTranscript<Challenger_>
where F: Field, Challenger_: Challenger,

Source§

fn send_one(&mut self, elem: F)

Source§

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

Source§

fn observe_one(&mut self, val: F)

Source§

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

Source§

fn sample(&mut self) -> F

Implementors§