From 88e065665086ab0b0b17cfe4cb1758a1fc63db8e Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Fri, 20 Aug 2021 08:58:48 -0700 Subject: [PATCH] Address a few more unused warnings (#196) --- src/plonk/plonk_common.rs | 40 +------------------------------------- src/polynomial/division.rs | 2 +- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/plonk/plonk_common.rs b/src/plonk/plonk_common.rs index 890a67c5..87d9d9bb 100644 --- a/src/plonk/plonk_common.rs +++ b/src/plonk/plonk_common.rs @@ -1,12 +1,9 @@ -use std::borrow::Borrow; - use crate::field::extension_field::target::ExtensionTarget; use crate::field::extension_field::Extendable; use crate::field::field_types::Field; use crate::fri::commitment::SALT_SIZE; use crate::iop::target::Target; use crate::plonk::circuit_builder::CircuitBuilder; -use crate::polynomial::polynomial::PolynomialCoeffs; use crate::util::reducing::ReducingFactorTarget; /// Holds the Merkle tree index and blinding flag of a set of polynomials used in FRI. @@ -46,6 +43,7 @@ impl PlonkPolynomials { blinding: true, }; + #[cfg(test)] pub fn polynomials(i: usize) -> PolynomialsIndexBlinding { match i { 0 => Self::CONSTANTS_SIGMAS, @@ -165,18 +163,6 @@ pub(crate) fn reduce_with_powers(terms: &[F], alpha: F) -> F { sum } -pub(crate) fn reduce_with_powers_recursive, const D: usize>( - builder: &mut CircuitBuilder, - terms: &[Target], - alpha: Target, -) -> Target { - let mut sum = builder.zero(); - for &term in terms.iter().rev() { - sum = builder.mul_add(sum, alpha, term); - } - sum -} - pub(crate) fn reduce_with_powers_ext_recursive, const D: usize>( builder: &mut CircuitBuilder, terms: &[ExtensionTarget], @@ -186,27 +172,3 @@ pub(crate) fn reduce_with_powers_ext_recursive, const D: usize> let mut alpha = ReducingFactorTarget::new(alpha); alpha.reduce(terms, builder) } - -/// Reduce a sequence of field elements by the given coefficients. -pub(crate) fn reduce_with_iter( - terms: impl IntoIterator>, - coeffs: impl IntoIterator>, -) -> F { - terms - .into_iter() - .zip(coeffs) - .map(|(t, c)| *t.borrow() * *c.borrow()) - .sum() -} - -/// Reduce a sequence of polynomials by the given coefficients. -pub(crate) fn reduce_polys_with_iter( - polys: impl IntoIterator>>, - coeffs: impl IntoIterator>, -) -> PolynomialCoeffs { - polys - .into_iter() - .zip(coeffs) - .map(|(p, c)| p.borrow() * *c.borrow()) - .sum() -} diff --git a/src/polynomial/division.rs b/src/polynomial/division.rs index 7dba226a..bbff96eb 100644 --- a/src/polynomial/division.rs +++ b/src/polynomial/division.rs @@ -6,7 +6,7 @@ use crate::util::{log2_ceil, log2_strict}; impl PolynomialCoeffs { /// Polynomial division. /// Returns `(q, r)`, the quotient and remainder of the polynomial division of `a` by `b`. - pub(crate) fn div_rem(&self, b: &Self) -> (Self, Self) { + pub fn div_rem(&self, b: &Self) -> (Self, Self) { let (a_degree_plug_1, b_degree_plus_1) = (self.degree_plus_one(), b.degree_plus_one()); if a_degree_plug_1 == 0 { (Self::zero(1), Self::empty())