File tree 7 files changed +16
-3
lines changed
7 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1
1
use super :: group:: { GroupElement , VartimeMultiscalarMul , GROUP_BASEPOINT_COMPRESSED } ;
2
2
use super :: scalar:: Scalar ;
3
3
use digest:: { ExtendableOutput , Input , XofReader } ;
4
+ use serde:: { Deserialize , Serialize } ;
4
5
use sha3:: Shake256 ;
5
6
6
- #[ derive( Debug ) ]
7
+ #[ derive( Debug , Serialize , Deserialize ) ]
7
8
pub struct MultiCommitGens {
8
9
pub n : usize ,
9
10
pub G : Vec < GroupElement > ,
Original file line number Diff line number Diff line change @@ -14,13 +14,14 @@ use serde::{Deserialize, Serialize};
14
14
#[ cfg( feature = "multicore" ) ]
15
15
use rayon:: prelude:: * ;
16
16
17
- #[ derive( Debug ) ]
17
+ #[ derive( Debug , Serialize , Deserialize ) ]
18
18
pub struct DensePolynomial {
19
19
num_vars : usize , // the number of variables in the multilinear polynomial
20
20
len : usize ,
21
21
Z : Vec < Scalar > , // evaluations of the polynomial in all the 2^num_vars Boolean inputs
22
22
}
23
23
24
+ #[ derive( Serialize , Deserialize ) ]
24
25
pub struct PolyCommitmentGens {
25
26
pub gens : DotProductProofGens ,
26
27
}
Original file line number Diff line number Diff line change @@ -45,17 +45,19 @@ use timer::Timer;
45
45
use transcript:: { AppendToTranscript , ProofTranscript } ;
46
46
47
47
/// `ComputationCommitment` holds a public preprocessed NP statement (e.g., R1CS)
48
+ #[ derive( Serialize , Deserialize ) ]
48
49
pub struct ComputationCommitment {
49
50
comm : R1CSCommitment ,
50
51
}
51
52
52
53
/// `ComputationDecommitment` holds information to decommit `ComputationCommitment`
54
+ #[ derive( Serialize , Deserialize ) ]
53
55
pub struct ComputationDecommitment {
54
56
decomm : R1CSDecommitment ,
55
57
}
56
58
57
59
/// `Assignment` holds an assignment of values to either the inputs or variables in an `Instance`
58
- #[ derive( Clone ) ]
60
+ #[ derive( Clone , Serialize , Deserialize ) ]
59
61
pub struct Assignment {
60
62
assignment : Vec < Scalar > ,
61
63
}
@@ -276,6 +278,7 @@ impl Instance {
276
278
}
277
279
278
280
/// `SNARKGens` holds public parameters for producing and verifying proofs with the Spartan SNARK
281
+ #[ derive( Serialize , Deserialize ) ]
279
282
pub struct SNARKGens {
280
283
gens_r1cs_sat : R1CSGens ,
281
284
gens_r1cs_eval : R1CSCommitmentGens ,
Original file line number Diff line number Diff line change @@ -404,6 +404,7 @@ impl DotProductProof {
404
404
}
405
405
}
406
406
407
+ #[ derive( Serialize , Deserialize ) ]
407
408
pub struct DotProductProofGens {
408
409
n : usize ,
409
410
pub gens_n : MultiCommitGens ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ pub struct R1CSInstance {
25
25
C : SparseMatPolynomial ,
26
26
}
27
27
28
+ #[ derive( Serialize , Deserialize ) ]
28
29
pub struct R1CSCommitmentGens {
29
30
gens : SparseMatPolyCommitmentGens ,
30
31
}
@@ -63,6 +64,7 @@ impl AppendToTranscript for R1CSCommitment {
63
64
}
64
65
}
65
66
67
+ #[ derive( Serialize , Deserialize ) ]
66
68
pub struct R1CSDecommitment {
67
69
dense : MultiSparseMatPolynomialAsDense ,
68
70
}
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ pub struct R1CSProof {
36
36
proof_eq_sc_phase2 : EqualityProof ,
37
37
}
38
38
39
+ #[ derive( Serialize , Deserialize ) ]
39
40
pub struct R1CSSumcheckGens {
40
41
gens_1 : MultiCommitGens ,
41
42
gens_3 : MultiCommitGens ,
@@ -57,6 +58,7 @@ impl R1CSSumcheckGens {
57
58
}
58
59
}
59
60
61
+ #[ derive( Serialize , Deserialize ) ]
60
62
pub struct R1CSGens {
61
63
gens_sc : R1CSSumcheckGens ,
62
64
gens_pc : PolyCommitmentGens ,
Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ impl AppendToTranscript for DerefsCommitment {
209
209
}
210
210
}
211
211
212
+ #[ derive( Serialize , Deserialize ) ]
212
213
struct AddrTimestamps {
213
214
ops_addr_usize : Vec < Vec < usize > > ,
214
215
ops_addr : Vec < DensePolynomial > ,
@@ -270,6 +271,7 @@ impl AddrTimestamps {
270
271
}
271
272
}
272
273
274
+ #[ derive( Serialize , Deserialize ) ]
273
275
pub struct MultiSparseMatPolynomialAsDense {
274
276
batch_size : usize ,
275
277
val : Vec < DensePolynomial > ,
@@ -279,6 +281,7 @@ pub struct MultiSparseMatPolynomialAsDense {
279
281
comb_mem : DensePolynomial ,
280
282
}
281
283
284
+ #[ derive( Serialize , Deserialize ) ]
282
285
pub struct SparseMatPolyCommitmentGens {
283
286
gens_ops : PolyCommitmentGens ,
284
287
gens_mem : PolyCommitmentGens ,
You can’t perform that action at this time.
0 commit comments