Skip to main content

p3_circle/
proof.rs

1use alloc::vec::Vec;
2
3use p3_commit::Mmcs;
4use p3_field::Field;
5use serde::{Deserialize, Serialize};
6
7#[derive(Serialize, Deserialize, Clone)]
8#[serde(bound(
9    serialize = "Witness: Serialize, InputProof: Serialize",
10    deserialize = "Witness: Deserialize<'de>, InputProof: Deserialize<'de>"
11))]
12pub struct CircleFriProof<F: Field, M: Mmcs<F>, Witness, InputProof> {
13    pub commit_phase_commits: Vec<M::Commitment>,
14    pub query_proofs: Vec<CircleQueryProof<F, M, InputProof>>,
15    // This could become Vec<FC::Challenge> if this library was generalized to support non-constant
16    // final polynomials.
17    pub final_poly: F,
18    pub pow_witness: Witness,
19}
20
21#[derive(Serialize, Deserialize, Clone)]
22#[serde(bound(
23    serialize = "InputProof: Serialize",
24    deserialize = "InputProof: Deserialize<'de>",
25))]
26pub struct CircleQueryProof<F: Field, M: Mmcs<F>, InputProof> {
27    pub input_proof: InputProof,
28    /// For each commit phase commitment, this contains openings of a commit phase codeword at the
29    /// queried location, along with an opening proof.
30    pub commit_phase_openings: Vec<CircleCommitPhaseProofStep<F, M>>,
31}
32
33#[derive(Debug, Serialize, Deserialize, Clone)]
34#[serde(bound = "")]
35pub struct CircleCommitPhaseProofStep<F: Field, M: Mmcs<F>> {
36    /// The log2 of the folding arity used for this step.
37    pub log_arity: u8,
38    /// The openings of the commit phase codeword at the sibling locations.
39    /// For arity k, this contains k-1 sibling values.
40    pub sibling_values: Vec<F>,
41
42    pub opening_proof: M::Proof,
43}