arnaucube
arnaucube/hyperplonkPublic Self-hosted repository
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/// An IOP proof is a collections of messages from prover to verifier at each
 7/// round through the interactive protocol.
 8#[derive(Clone, Debug, Default, PartialEq)]
 9pub struct IOPProof<F: PrimeField> {
10    pub proofs: Vec<IOPProverMessage<F>>,
11}
12
13/// A message from the prover to the verifier at a given round
14/// is a list of evaluations.
15#[derive(Clone, Debug, Default, PartialEq)]
16pub struct IOPProverMessage<F: PrimeField> {
17    pub(crate) evaluations: Vec<F>,
18}
19
20/// Prover State of a PolyIOP.
21pub struct IOPProverState<F: PrimeField> {
22    /// sampled randomness given by the verifier
23    pub challenges: Vec<F>,
24    /// the current round number
25    pub(crate) round: usize,
26    /// pointer to the virtual polynomial
27    pub(crate) poly: VirtualPolynomial<F>,
28}
29
30/// Prover State of a PolyIOP
31pub struct IOPVerifierState<F: PrimeField> {
32    pub(crate) round: usize,
33    pub(crate) num_vars: usize,
34    pub(crate) max_degree: usize,
35    pub(crate) finished: bool,
36    /// a list storing the univariate polynomial in evaluation form sent by the
37    /// prover at each round
38    pub(crate) polynomials_received: Vec<Vec<F>>,
39    /// a list storing the randomness sampled by the verifier at each round
40    pub(crate) challenges: Vec<F>,
41}