hyperplonk/poly-iop/src/structs.rs
poly-iop/src/structs.rsRaw
1//! This module defines structs that are shared by all sub protocols.
2
3use crate::VirtualPolynomial;
4use ark_ff::PrimeField;
5
6/// A Subclaim is a claim generated by the verifier at the end of verification
7/// when it is convinced.
8pub struct SubClaim<F: PrimeField> {
9 /// the multi-dimensional point that this multilinear extension is evaluated
10 /// to
11 pub point: Vec<F>,
12 /// the expected evaluation
13 pub expected_evaluation: F,
14}
15
16/// An IOP proof is a collections of messages from prover to verifier at each
17/// round through the interactive protocol.
18#[derive(Clone, Debug, Default, PartialEq)]
19pub struct IOPProof<F: PrimeField> {
20 pub proofs: Vec<IOPProverMessage<F>>,
21}
22
23/// A message from the prover to the verifier at a given round
24/// is a list of evaluations.
25#[derive(Clone, Debug, Default, PartialEq)]
26pub struct IOPProverMessage<F: PrimeField> {
27 pub(crate) evaluations: Vec<F>,
28}
29
30/// Prover State of a PolyIOP.
31pub struct IOPProverState<F: PrimeField> {
32 /// sampled randomness given by the verifier
33 pub challenges: Vec<F>,
34 /// the current round number
35 pub(crate) round: usize,
36 /// pointer to the virtual polynomial
37 pub(crate) poly: VirtualPolynomial<F>,
38}
39
40/// Prover State of a PolyIOP
41pub struct IOPVerifierState<F: PrimeField> {
42 pub(crate) round: usize,
43 pub(crate) num_vars: usize,
44 pub(crate) max_degree: usize,
45 pub(crate) finished: bool,
46 /// a list storing the univariate polynomial in evaluation form sent by the
47 /// prover at each round
48 pub(crate) polynomials_received: Vec<Vec<F>>,
49 /// a list storing the randomness sampled by the verifier at each round
50 pub(crate) challenges: Vec<F>,
51}