Skip to content

Commit

Permalink
cleanup unused visibility modifiers (microsoft#314)
Browse files Browse the repository at this point in the history
update doc
  • Loading branch information
srinathsetty authored and huitseeker committed Mar 12, 2024
1 parent 723f062 commit df6d6f6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/spartan/batched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::{
math::Math,
polys::{eq::EqPolynomial, multilinear::MultilinearPolynomial},
powers,
snark::batch_eval_prove,
snark::batch_eval_reduce,
sumcheck::SumcheckProof,
PolyEvalInstance, PolyEvalWitness,
};
Expand Down Expand Up @@ -348,7 +348,7 @@ impl<E: Engine, EE: EvaluationEngineTrait<E>> BatchedRelaxedR1CSSNARKTrait<E>
};

let (batched_u, batched_w, sc_proof_batch, claims_batch_left) =
batch_eval_prove(u_vec, &w_vec, &mut transcript)?;
batch_eval_reduce(u_vec, &w_vec, &mut transcript)?;

let eval_arg = EE::prove(
ck,
Expand Down
2 changes: 1 addition & 1 deletion src/spartan/polys/power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<Scalar: PrimeField> PowPolynomial<Scalar> {

/// Create powers the following powers of `t`:
/// [t^{2^0}, t^{2^1}, ..., t^{2^{ell-1}}]
pub(in crate::spartan) fn squares(t: &Scalar, ell: usize) -> Vec<Scalar> {
pub fn squares(t: &Scalar, ell: usize) -> Vec<Scalar> {
successors(Some(*t), |p: &Scalar| Some(p.square()))
.take(ell)
.collect::<Vec<_>>()
Expand Down
3 changes: 2 additions & 1 deletion src/spartan/ppsnark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,11 @@ impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for Relax
let u: PolyEvalInstance<E> =
PolyEvalInstance::batch(&comm_vec, tau_coords.clone(), &eval_vec, &c);

// we now need to prove three claims
// we now need to prove four claims
// (1) 0 = \sum_x poly_tau(x) * (poly_Az(x) * poly_Bz(x) - poly_uCz_E(x)), and eval_Az_at_tau + r * eval_Bz_at_tau + r^2 * eval_Cz_at_tau = (Az+r*Bz+r^2*Cz)(tau)
// (2) eval_Az_at_tau + c * eval_Bz_at_tau + c^2 * eval_Cz_at_tau = \sum_y L_row(y) * (val_A(y) + c * val_B(y) + c^2 * val_C(y)) * L_col(y)
// (3) L_row(i) = eq(tau, row(i)) and L_col(i) = z(col(i))
// (4) Check that the witness polynomial W is well-formed e.g., it is padded with only zeros
let gamma = transcript.squeeze(b"g")?;
let r = transcript.squeeze(b"r")?;

Expand Down
8 changes: 4 additions & 4 deletions src/spartan/snark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for Relax
];

let (batched_u, batched_w, sc_proof_batch, claims_batch_left) =
batch_eval_prove(u_vec, &w_vec, &mut transcript)?;
batch_eval_reduce(u_vec, &w_vec, &mut transcript)?;

let eval_arg = EE::prove(
ck,
Expand Down Expand Up @@ -415,8 +415,8 @@ impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for Relax
}
}

/// Proves a batch of polynomial evaluation claims using Sumcheck
/// reducing them to a single claim at the same point.
/// Reduces a batch of polynomial evaluation claims using Sumcheck
/// to a single claim at the same point.
///
/// # Details
///
Expand All @@ -429,7 +429,7 @@ impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for Relax
///
/// We allow the polynomial Pᵢ to have different sizes, by appropriately scaling
/// the claims and resulting evaluations from Sumcheck.
pub(in crate::spartan) fn batch_eval_prove<E: Engine>(
pub (in crate::spartan) fn batch_eval_reduce<E: Engine>(
u_vec: Vec<PolyEvalInstance<E>>,
w_vec: &[PolyEvalWitness<E>],
transcript: &mut E::TE,
Expand Down

0 comments on commit df6d6f6

Please sign in to comment.