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 opening of the commit phase codeword at the sibling location.
37    // This may change to Vec<FC::Challenge> if the library is generalized to support other FRI
38    // folding arities besides 2, meaning that there can be multiple siblings.
39    pub sibling_value: F,
40
41    pub opening_proof: M::Proof,
42}