Skip to content

Commit 7d12338

Browse files
committed
fmtr
1 parent a8ba63f commit 7d12338

File tree

3 files changed

+39
-41
lines changed

3 files changed

+39
-41
lines changed

spartan_parallel/src/dense_mlpoly.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ impl<S: SpartanExtensionField> PolyEvalProof<S> {
321321

322322
pub fn prove(
323323
poly: &DensePolynomial<S>,
324-
r: &[S], // point at which the polynomial is evaluated
325-
_Zr: &S, // evaluation of \widetilde{Z}(r)
324+
r: &[S], // point at which the polynomial is evaluated
325+
_Zr: &S, // evaluation of \widetilde{Z}(r)
326326
transcript: &mut Transcript,
327327
_random_tape: &mut RandomTape<S>,
328328
) -> PolyEvalProof<S> {
@@ -383,8 +383,8 @@ impl<S: SpartanExtensionField> PolyEvalProof<S> {
383383
// Evaluation of multiple points on the same instance
384384
pub fn prove_batched_points(
385385
poly: &DensePolynomial<S>,
386-
r_list: Vec<Vec<S>>, // point at which the polynomial is evaluated
387-
Zr_list: Vec<S>, // evaluation of \widetilde{Z}(r) on each point
386+
r_list: Vec<Vec<S>>, // point at which the polynomial is evaluated
387+
Zr_list: Vec<S>, // evaluation of \widetilde{Z}(r) on each point
388388
transcript: &mut Transcript,
389389
_random_tape: &mut RandomTape<S>,
390390
) -> Vec<PolyEvalProof<S>> {
@@ -440,7 +440,7 @@ impl<S: SpartanExtensionField> PolyEvalProof<S> {
440440
// compute vector-matrix product between L and Z viewed as a matrix
441441
let LZ = poly.bound(L);
442442

443-
proof_list.push(PolyEvalProof{ v: LZ });
443+
proof_list.push(PolyEvalProof { v: LZ });
444444
}
445445

446446
proof_list
@@ -497,8 +497,8 @@ impl<S: SpartanExtensionField> PolyEvalProof<S> {
497497
// Size of each instance might be different, but all are larger than the evaluation point
498498
pub fn prove_batched_instances(
499499
poly_list: &Vec<DensePolynomial<S>>, // list of instances
500-
r_list: Vec<&Vec<S>>, // point at which the polynomial is evaluated
501-
Zr_list: &Vec<S>, // evaluation of \widetilde{Z}(r) on each instance
500+
r_list: Vec<&Vec<S>>, // point at which the polynomial is evaluated
501+
Zr_list: &Vec<S>, // evaluation of \widetilde{Z}(r) on each instance
502502
transcript: &mut Transcript,
503503
_random_tape: &mut RandomTape<S>,
504504
) -> Vec<PolyEvalProof<S>> {
@@ -563,7 +563,7 @@ impl<S: SpartanExtensionField> PolyEvalProof<S> {
563563
for v in LZ_list.into_iter() {
564564
proof_list.push(PolyEvalProof { v });
565565
}
566-
566+
567567
proof_list
568568
}
569569

@@ -698,7 +698,7 @@ impl<S: SpartanExtensionField> PolyEvalProof<S> {
698698

699699
let mut proof_list = Vec::new();
700700
for v in LZ_list.into_iter() {
701-
proof_list.push(PolyEvalProof{ v });
701+
proof_list.push(PolyEvalProof { v });
702702
}
703703

704704
proof_list

spartan_parallel/src/r1csproof.rs

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,22 @@ impl<S: SpartanExtensionField> R1CSProof<S> {
8888
let comb_func = |poly_A_comp: &S, poly_B_comp: &S, poly_C_comp: &S| -> S {
8989
*poly_A_comp * *poly_B_comp * *poly_C_comp
9090
};
91-
let (sc_proof_phase_two, r, claims) =
92-
SumcheckInstanceProof::<S>::prove_cubic_disjoint_rounds(
93-
claim,
94-
num_rounds,
95-
num_rounds_y_max,
96-
num_rounds_w,
97-
num_rounds_p,
98-
single_inst,
99-
num_witness_secs,
100-
num_inputs,
101-
evals_eq,
102-
evals_ABC,
103-
evals_z,
104-
comb_func,
105-
transcript,
106-
random_tape,
107-
);
91+
let (sc_proof_phase_two, r, claims) = SumcheckInstanceProof::<S>::prove_cubic_disjoint_rounds(
92+
claim,
93+
num_rounds,
94+
num_rounds_y_max,
95+
num_rounds_w,
96+
num_rounds_p,
97+
single_inst,
98+
num_witness_secs,
99+
num_inputs,
100+
evals_eq,
101+
evals_ABC,
102+
evals_z,
103+
comb_func,
104+
transcript,
105+
random_tape,
106+
);
108107

109108
(sc_proof_phase_two, r, claims)
110109
}
@@ -620,10 +619,12 @@ impl<S: SpartanExtensionField> R1CSProof<S> {
620619
let tau_q = transcript.challenge_vector(b"challenge_tau_q", num_rounds_q);
621620
let tau_x = transcript.challenge_vector(b"challenge_tau_x", num_rounds_x);
622621

623-
let (_, rx) =
624-
self
625-
.sc_proof_phase1
626-
.verify(S::field_zero(), num_rounds_x + num_rounds_q + num_rounds_p, 3, transcript)?;
622+
let (_, rx) = self.sc_proof_phase1.verify(
623+
S::field_zero(),
624+
num_rounds_x + num_rounds_q + num_rounds_p,
625+
3,
626+
transcript,
627+
)?;
627628

628629
// debug_zk
629630
// perform the intermediate sum-check test with claimed Az, Bz, and Cz
@@ -668,10 +669,12 @@ impl<S: SpartanExtensionField> R1CSProof<S> {
668669
let claim_phase2 = r_A * Az_claim + r_B * Bz_claim + r_C * Cz_claim;
669670

670671
// verify the joint claim with a sum-check protocol
671-
let (_, ry) =
672-
self
673-
.sc_proof_phase2
674-
.verify(claim_phase2, num_rounds_y + num_rounds_w + num_rounds_p, 3, transcript)?;
672+
let (_, ry) = self.sc_proof_phase2.verify(
673+
claim_phase2,
674+
num_rounds_y + num_rounds_w + num_rounds_p,
675+
3,
676+
transcript,
677+
)?;
675678

676679
// Separate ry into rp, rw, and ry
677680
let (ry_rev, rw) = ry.split_at(num_rounds_y);

spartan_parallel/src/sparse_mlpoly.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,8 @@ impl<S: SpartanExtensionField> DerefsEvalProof<S> {
104104
// decommit the joint polynomial at r_joint
105105
S::append_field_to_transcript(b"joint_claim_eval", transcript, eval_joint);
106106

107-
let proof_derefs = PolyEvalProof::prove(
108-
joint_poly,
109-
&r_joint,
110-
&eval_joint,
111-
transcript,
112-
random_tape,
113-
);
107+
let proof_derefs =
108+
PolyEvalProof::prove(joint_poly, &r_joint, &eval_joint, transcript, random_tape);
114109

115110
proof_derefs
116111
}

0 commit comments

Comments
 (0)