@@ -29,7 +29,7 @@ mod tests;
29
29
serialize = "E::BaseField: Serialize" ,
30
30
deserialize = "E::BaseField: DeserializeOwned"
31
31
) ) ]
32
- pub struct ZKVMOpcodeProof < E : ExtensionField , PCS : PolynomialCommitmentScheme < E > > {
32
+ pub struct ZKVMOpcodeProof < E : ExtensionField > {
33
33
// TODO support >1 opcodes
34
34
pub num_instances : usize ,
35
35
@@ -51,7 +51,6 @@ pub struct ZKVMOpcodeProof<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>
51
51
pub w_records_in_evals : Vec < E > ,
52
52
pub lk_records_in_evals : Vec < E > ,
53
53
54
- pub wits_commit : PCS :: Commitment ,
55
54
pub wits_in_evals : Vec < E > ,
56
55
}
57
56
@@ -60,7 +59,7 @@ pub struct ZKVMOpcodeProof<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>
60
59
serialize = "E::BaseField: Serialize" ,
61
60
deserialize = "E::BaseField: DeserializeOwned"
62
61
) ) ]
63
- pub struct ZKVMTableProof < E : ExtensionField , PCS : PolynomialCommitmentScheme < E > > {
62
+ pub struct ZKVMTableProof < E : ExtensionField > {
64
63
// tower evaluation at layer 1
65
64
pub r_out_evals : Vec < [ E ; 2 ] > ,
66
65
pub w_out_evals : Vec < [ E ; 2 ] > ,
@@ -76,10 +75,7 @@ pub struct ZKVMTableProof<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>>
76
75
pub rw_hints_num_vars : Vec < usize > ,
77
76
78
77
pub fixed_in_evals : Vec < E > ,
79
- pub fixed_opening_proof : Option < PCS :: Proof > ,
80
- pub wits_commit : PCS :: Commitment ,
81
78
pub wits_in_evals : Vec < E > ,
82
- pub wits_opening_proof : PCS :: Proof ,
83
79
}
84
80
85
81
/// each field will be interpret to (constant) polynomial
@@ -143,14 +139,30 @@ pub struct ZKVMProof<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> {
143
139
pub raw_pi : Vec < Vec < E :: BaseField > > ,
144
140
// the evaluation of raw_pi.
145
141
pub pi_evals : Vec < E > ,
146
- opcode_proofs : BTreeMap < String , ( usize , ZKVMOpcodeProof < E , PCS > ) > ,
147
- table_proofs : BTreeMap < String , ( usize , ZKVMTableProof < E , PCS > ) > ,
142
+ opcode_proofs : BTreeMap < String , ( usize , ZKVMOpcodeProof < E > ) > ,
143
+ table_proofs : BTreeMap < String , ( usize , ZKVMTableProof < E > ) > ,
144
+ pub fixed_witin_opening_proof : PCS :: Proof ,
148
145
}
149
146
150
147
impl < E : ExtensionField , PCS : PolynomialCommitmentScheme < E > > ZKVMProof < E , PCS > {
151
- pub fn empty ( pv : PublicValues < u32 > ) -> Self {
152
- let raw_pi = pv. to_vec :: < E > ( ) ;
153
- let pi_evals = raw_pi
148
+ pub fn new (
149
+ raw_pi : Vec < Vec < E :: BaseField > > ,
150
+ pi_evals : Vec < E > ,
151
+ opcode_proofs : BTreeMap < String , ( usize , ZKVMOpcodeProof < E > ) > ,
152
+ table_proofs : BTreeMap < String , ( usize , ZKVMTableProof < E > ) > ,
153
+ fixed_witin_opening_proof : PCS :: Proof ,
154
+ ) -> Self {
155
+ Self {
156
+ raw_pi,
157
+ pi_evals,
158
+ opcode_proofs,
159
+ table_proofs,
160
+ fixed_witin_opening_proof,
161
+ }
162
+ }
163
+
164
+ pub fn pi_evals ( raw_pi : & Vec < Vec < E :: BaseField > > ) -> Vec < E > {
165
+ raw_pi
154
166
. iter ( )
155
167
. map ( |pv| {
156
168
if pv. len ( ) == 1 {
@@ -162,13 +174,7 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> ZKVMProof<E, PCS> {
162
174
E :: ZERO
163
175
}
164
176
} )
165
- . collect_vec ( ) ;
166
- Self {
167
- raw_pi,
168
- pi_evals,
169
- opcode_proofs : BTreeMap :: new ( ) ,
170
- table_proofs : BTreeMap :: new ( ) ,
171
- }
177
+ . collect_vec ( )
172
178
}
173
179
174
180
pub fn update_pi_eval ( & mut self , idx : usize , v : E ) {
0 commit comments