You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.7 KiB

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