@@ -4,12 +4,18 @@ use p3_commit::Mmcs;
44use p3_field:: Field ;
55use serde:: { Deserialize , Serialize } ;
66
7- #[ derive( Serialize , Deserialize ) ]
7+ #[ derive( Serialize , Deserialize , Clone ) ]
88#[ serde( bound(
99 serialize = "Witness: Serialize" ,
1010 deserialize = "Witness: Deserialize<'de>"
1111) ) ]
12- pub struct FriProof < F : Field , M : Mmcs < F > , Witness > {
12+ pub struct FriProof < F : Field , M : Mmcs < F > , Witness >
13+ where
14+ F : Send + Sync ,
15+ M :: Commitment : Send + Sync ,
16+ M :: Proof : Send + Sync ,
17+ Witness : Send + Sync ,
18+ {
1319 pub ( crate ) commit_phase_commits : Vec < M :: Commitment > ,
1420 pub ( crate ) query_proofs : Vec < QueryProof < F , M > > ,
1521 // This could become Vec<FC::Challenge> if this library was generalized to support non-constant
@@ -18,22 +24,62 @@ pub struct FriProof<F: Field, M: Mmcs<F>, Witness> {
1824 pub ( crate ) pow_witness : Witness ,
1925}
2026
21- #[ derive( Serialize , Deserialize ) ]
27+ unsafe impl < F : Field + Send + Sync , M : Mmcs < F > , Witness : Send + Sync > Send
28+ for FriProof < F , M , Witness >
29+ where
30+ M :: Commitment : Send + Sync ,
31+ M :: Proof : Send + Sync ,
32+ {
33+ }
34+
35+ unsafe impl < F : Field + Send + Sync , M : Mmcs < F > , Witness : Send + Sync > Sync
36+ for FriProof < F , M , Witness >
37+ where
38+ M :: Commitment : Send + Sync ,
39+ M :: Proof : Send + Sync ,
40+ {
41+ }
42+
43+ /// For each commit phase commitment, this contains openings of a commit phase codeword at the
44+ /// queried location, along with an opening proof.
45+ #[ derive( Serialize , Deserialize , Clone ) ]
2246#[ serde( bound = "" ) ]
23- pub struct QueryProof < F : Field , M : Mmcs < F > > {
24- /// For each commit phase commitment, this contains openings of a commit phase codeword at the
25- /// queried location, along with an opening proof.
47+ pub struct QueryProof < F : Field , M : Mmcs < F > >
48+ where
49+ F : Send + Sync ,
50+ M :: Proof : Send + Sync ,
51+ {
2652 pub ( crate ) commit_phase_openings : Vec < CommitPhaseProofStep < F , M > > ,
2753}
2854
29- #[ derive( Serialize , Deserialize ) ]
55+ unsafe impl < F : Field + Send + Sync , M : Mmcs < F > > Send for QueryProof < F , M > where M :: Proof : Send + Sync
56+ { }
57+
58+ unsafe impl < F : Field + Send + Sync , M : Mmcs < F > > Sync for QueryProof < F , M > where M :: Proof : Send + Sync
59+ { }
60+
61+ // The opening of the commit phase codeword at the sibling location.
62+ // This may change to Vec<FC::Challenge> if the library is generalized to support other FRI
63+ // folding arities besides 2, meaning that there can be multiple siblings.
64+ #[ derive( Serialize , Deserialize , Clone ) ]
3065// #[serde(bound(serialize = "F: Serialize"))]
3166#[ serde( bound = "" ) ]
32- pub struct CommitPhaseProofStep < F : Field , M : Mmcs < F > > {
33- /// The opening of the commit phase codeword at the sibling location.
34- // This may change to Vec<FC::Challenge> if the library is generalized to support other FRI
35- // folding arities besides 2, meaning that there can be multiple siblings.
67+ pub struct CommitPhaseProofStep < F : Field , M : Mmcs < F > >
68+ where
69+ F : Send + Sync ,
70+ M :: Proof : Send + Sync ,
71+ {
3672 pub ( crate ) sibling_value : F ,
3773
3874 pub ( crate ) opening_proof : M :: Proof ,
3975}
76+
77+ unsafe impl < F : Field + Send + Sync , M : Mmcs < F > > Send for CommitPhaseProofStep < F , M > where
78+ M :: Proof : Send + Sync
79+ {
80+ }
81+
82+ unsafe impl < F : Field + Send + Sync , M : Mmcs < F > > Sync for CommitPhaseProofStep < F , M > where
83+ M :: Proof : Send + Sync
84+ {
85+ }
0 commit comments