Skip to content

Commit

Permalink
chore: removing all uneeded public modifiers
Browse files Browse the repository at this point in the history
- removing public modifier in  src/spartan/ppsnark.rs

- removing public modifier in  src/spartan/sumcheck/mod.rs

- removing public modifier in src/spartan/mod.rs

- removing public modifier in src/spartan/polys/masked_eq.rs

- removing public modifier in src/supernova/mod.rs
  • Loading branch information
huitseeker committed Jan 5, 2024
1 parent 9281aba commit 49ab50c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/spartan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod batched_ppsnark;
pub mod direct;
#[macro_use]
mod macros;
pub(crate) mod math;
mod math;
pub mod polys;
pub mod ppsnark;
pub mod snark;
Expand All @@ -38,7 +38,7 @@ fn powers<E: Engine>(s: &E::Scalar, n: usize) -> Vec<E::Scalar> {
}

/// A type that holds a witness to a polynomial evaluation instance
pub struct PolyEvalWitness<E: Engine> {
struct PolyEvalWitness<E: Engine> {
p: Vec<E::Scalar>, // polynomial
}

Expand Down Expand Up @@ -116,7 +116,7 @@ impl<E: Engine> PolyEvalWitness<E> {
}

/// A type that holds a polynomial evaluation instance
pub struct PolyEvalInstance<E: Engine> {
struct PolyEvalInstance<E: Engine> {
c: Commitment<E>, // commitment to the polynomial
x: Vec<E::Scalar>, // evaluation point
e: E::Scalar, // claimed evaluation
Expand Down Expand Up @@ -192,7 +192,7 @@ impl<E: Engine> PolyEvalInstance<E> {
}

/// Bounds "row" variables of (A, B, C) matrices viewed as 2d multilinear polynomials
pub fn compute_eval_table_sparse<E: Engine>(
fn compute_eval_table_sparse<E: Engine>(
S: &R1CSShape<E>,
rx: &[E::Scalar],
) -> (Vec<E::Scalar>, Vec<E::Scalar>, Vec<E::Scalar>) {
Expand Down
2 changes: 1 addition & 1 deletion src/spartan/polys/masked_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'a, Scalar: PrimeField> MaskedEqPolynomial<'a, Scalar> {
/// representation.
///
/// Returns a vector of Scalars, each corresponding to the polynomial evaluation at a specific point.
pub fn evals_from_points(r: &[Scalar], num_masked_vars: usize) -> Vec<Scalar> {
fn evals_from_points(r: &[Scalar], num_masked_vars: usize) -> Vec<Scalar> {
let mut evals = EqPolynomial::evals_from_points(r);

// replace the first 2^m evaluations with 0
Expand Down
2 changes: 1 addition & 1 deletion src/spartan/ppsnark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl<E: Engine> R1CSShapeSparkRepr<E> {
}

// computes evaluation oracles
pub(in crate::spartan) fn evaluation_oracles(
fn evaluation_oracles(
&self,
S: &R1CSShape<E>,
r_x: &E::Scalar,
Expand Down
6 changes: 3 additions & 3 deletions src/spartan/sumcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl<E: Engine> SumcheckProof<E> {
}

#[inline]
pub(in crate::spartan) fn compute_eval_points_quad<F>(
fn compute_eval_points_quad<F>(
poly_A: &MultilinearPolynomial<E::Scalar>,
poly_B: &MultilinearPolynomial<E::Scalar>,
comb_func: &F,
Expand Down Expand Up @@ -297,7 +297,7 @@ impl<E: Engine> SumcheckProof<E> {
}

#[inline]
pub(in crate::spartan) fn compute_eval_points_cubic<F>(
fn compute_eval_points_cubic<F>(
poly_A: &MultilinearPolynomial<E::Scalar>,
poly_B: &MultilinearPolynomial<E::Scalar>,
poly_C: &MultilinearPolynomial<E::Scalar>,
Expand Down Expand Up @@ -341,7 +341,7 @@ impl<E: Engine> SumcheckProof<E> {
}

#[inline]
pub(in crate::spartan) fn compute_eval_points_cubic_with_additive_term<F>(
fn compute_eval_points_cubic_with_additive_term<F>(
poly_A: &MultilinearPolynomial<E::Scalar>,
poly_B: &MultilinearPolynomial<E::Scalar>,
poly_C: &MultilinearPolynomial<E::Scalar>,
Expand Down
8 changes: 4 additions & 4 deletions src/supernova/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ where
C2: StepCircuit<E2::Scalar>,
{
/// The internal circuit shapes
pub circuit_shapes: Vec<R1CSWithArity<E1>>,
circuit_shapes: Vec<R1CSWithArity<E1>>,

ro_consts_primary: ROConstants<E1>,
ro_consts_circuit_primary: ROConstantsCircuit<E2>,
Expand Down Expand Up @@ -373,7 +373,7 @@ where
}

/// Returns all the primary R1CS Shapes
pub fn primary_r1cs_shapes(&self) -> Vec<&R1CSShape<E1>> {
fn primary_r1cs_shapes(&self) -> Vec<&R1CSShape<E1>> {
self
.circuit_shapes
.iter()
Expand Down Expand Up @@ -1005,7 +1005,7 @@ where
}

/// Extension trait to simplify getting scalar form of initial circuit index.
pub trait InitialProgramCounter<E1, E2, C1, C2>: NonUniformCircuit<E1, E2, C1, C2>
trait InitialProgramCounter<E1, E2, C1, C2>: NonUniformCircuit<E1, E2, C1, C2>
where
E1: Engine<Base = <E2 as Engine>::Scalar>,
E2: Engine<Base = <E1 as Engine>::Scalar>,
Expand Down Expand Up @@ -1078,7 +1078,7 @@ fn num_ro_inputs(num_circuits: usize, num_limbs: usize, arity: usize, is_primary

pub mod error;
pub mod snark;
pub(crate) mod utils;
mod utils;

#[cfg(test)]
mod test;

0 comments on commit 49ab50c

Please sign in to comment.