Skip to content

Commit c3469b3

Browse files
committed
Pad rp for eq_poly
1 parent c4024af commit c3469b3

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

spartan_parallel/src/r1csproof.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ impl<'a, S: SpartanExtensionField + Send + Sync> R1CSProof<S> {
404404
let (rq, rx) = rq.split_at(num_rounds_q);
405405
let rq = rq.to_vec();
406406
let rq_rev: Vec<S> = rq.iter().copied().rev().collect();
407-
let rp = rp.to_vec();
407+
let mut rp = rp.to_vec();
408408

409409
// --
410410
// PHASE 2
@@ -466,13 +466,15 @@ impl<'a, S: SpartanExtensionField + Send + Sync> R1CSProof<S> {
466466
Z_poly.bound_poly_vars_rq(&rq_rev.to_vec());
467467
timer_tmp.stop();
468468

469-
// An Eq function to match p with rp
470-
let eq_p_rp_poly = DensePolynomial::new(EqPolynomial::new(rp).evals());
471-
472469
// == test ceno_verifier_bench
473470
let ABC_poly = ABC_poly.to_dense_poly();
474471
let Z_poly = Z_poly.to_dense_poly();
475472

473+
// An Eq function to match p with rp
474+
let max_num_vars_phase2 = ABC_poly.get_num_vars();
475+
rp.extend(std::iter::repeat(S::field_one()).take(max_num_vars_phase2 - rp.len()));
476+
let eq_p_rp_poly = DensePolynomial::new(EqPolynomial::new(rp).evals());
477+
476478
println!(
477479
"=> ABC_poly, Z_poly, eq_p_rop_poly num_variables: {:?}, {:?}, {:?}",
478480
ABC_poly.get_num_vars(),
@@ -496,21 +498,12 @@ impl<'a, S: SpartanExtensionField + Send + Sync> R1CSProof<S> {
496498
.into_mle()
497499
);
498500

499-
let max_num_vars_phase2 = ABC_poly.get_num_vars();
500-
501-
let ABC_eval_len = ABC_poly.Z.len();
502-
let eq_eval_len = eq_p_rp_poly.Z.len();
503-
let eq_padding = std::iter::repeat(GoldilocksExt2::ZERO).take(ABC_eval_len - eq_eval_len);
504-
505501
let arc_C: ArcMultilinearExtension<'a, GoldilocksExt2> = Arc::new(
506-
eq_p_rp_poly.Z
507-
.into_iter()
508-
.map(|s|
509-
GoldilocksExt2::from_raw_bytes_unchecked(&s.inner().to_raw_bytes())
510-
)
511-
.chain(eq_padding)
512-
.collect::<Vec<GoldilocksExt2>>()
513-
.into_mle()
502+
eq_p_rp_poly.Z.iter().clone().map(|s|
503+
GoldilocksExt2::from_raw_bytes_unchecked(&s.inner().to_raw_bytes())
504+
)
505+
.collect::<Vec<GoldilocksExt2>>()
506+
.into_mle()
514507
);
515508

516509
let num_threads_phase2 = 8;

0 commit comments

Comments
 (0)