diff --git a/src/gadgets/split_base.rs b/src/gadgets/split_base.rs index 69cfa377..72964826 100644 --- a/src/gadgets/split_base.rs +++ b/src/gadgets/split_base.rs @@ -11,11 +11,7 @@ use crate::plonk::circuit_builder::CircuitBuilder; impl, const D: usize> CircuitBuilder { /// Split the given element into a list of targets, where each one represents a /// base-B limb of the element, with little-endian ordering. - pub(crate) fn split_le_base( - &mut self, - x: Target, - num_limbs: usize, - ) -> Vec { + pub fn split_le_base(&mut self, x: Target, num_limbs: usize) -> Vec { let gate_type = BaseSumGate::::new(num_limbs); let gate = self.add_gate(gate_type.clone(), vec![]); let sum = Target::wire(gate, BaseSumGate::::WIRE_SUM); diff --git a/src/gates/gate_tree.rs b/src/gates/gate_tree.rs index 30dd01ed..1fbc1497 100644 --- a/src/gates/gate_tree.rs +++ b/src/gates/gate_tree.rs @@ -200,7 +200,7 @@ impl, const D: usize> Tree> { } /// Returns the tree's maximum filtered constraint degree. - fn max_filtered_degree(&self) -> usize { + pub fn max_filtered_degree(&self) -> usize { self.traversal() .into_iter() .map(|(g, p)| g.0.degree() + p.len()) diff --git a/src/hash/hash_types.rs b/src/hash/hash_types.rs index e6cb274a..56cb371f 100644 --- a/src/hash/hash_types.rs +++ b/src/hash/hash_types.rs @@ -30,7 +30,7 @@ impl HashOut { } } - pub(crate) fn rand() -> Self { + pub fn rand() -> Self { Self { elements: [F::rand(), F::rand(), F::rand(), F::rand()], } diff --git a/src/hash/merkle_proofs.rs b/src/hash/merkle_proofs.rs index 7a7b358d..2223dee9 100644 --- a/src/hash/merkle_proofs.rs +++ b/src/hash/merkle_proofs.rs @@ -191,18 +191,13 @@ impl, const D: usize> CircuitBuilder { self.random_access(cap_index, state_ext, cap_ext); } - pub(crate) fn assert_hashes_equal(&mut self, x: HashOutTarget, y: HashOutTarget) { + pub fn assert_hashes_equal(&mut self, x: HashOutTarget, y: HashOutTarget) { for i in 0..4 { self.assert_equal(x.elements[i], y.elements[i]); } } - pub(crate) fn named_assert_hashes_equal( - &mut self, - x: HashOutTarget, - y: HashOutTarget, - name: String, - ) { + pub fn named_assert_hashes_equal(&mut self, x: HashOutTarget, y: HashOutTarget, name: String) { for i in 0..4 { self.named_assert_equal( x.elements[i], diff --git a/src/iop/challenger.rs b/src/iop/challenger.rs index 70c7e310..19b20717 100644 --- a/src/iop/challenger.rs +++ b/src/iop/challenger.rs @@ -114,18 +114,6 @@ impl Challenger { .expect("Output buffer should be non-empty") } - pub fn get_2_challenges(&mut self) -> (F, F) { - (self.get_challenge(), self.get_challenge()) - } - - pub fn get_3_challenges(&mut self) -> (F, F, F) { - ( - self.get_challenge(), - self.get_challenge(), - self.get_challenge(), - ) - } - pub fn get_n_challenges(&mut self, n: usize) -> Vec { (0..n).map(|_| self.get_challenge()).collect() } @@ -279,24 +267,6 @@ impl RecursiveChallenger { .expect("Output buffer should be non-empty") } - pub(crate) fn get_2_challenges, const D: usize>( - &mut self, - builder: &mut CircuitBuilder, - ) -> (Target, Target) { - (self.get_challenge(builder), self.get_challenge(builder)) - } - - pub(crate) fn get_3_challenges, const D: usize>( - &mut self, - builder: &mut CircuitBuilder, - ) -> (Target, Target, Target) { - ( - self.get_challenge(builder), - self.get_challenge(builder), - self.get_challenge(builder), - ) - } - pub(crate) fn get_n_challenges, const D: usize>( &mut self, builder: &mut CircuitBuilder, diff --git a/src/plonk/circuit_data.rs b/src/plonk/circuit_data.rs index e4353c70..d711b45f 100644 --- a/src/plonk/circuit_data.rs +++ b/src/plonk/circuit_data.rs @@ -58,6 +58,7 @@ impl CircuitConfig { self.num_wires - self.num_routed_wires } + #[cfg(test)] pub(crate) fn large_config() -> Self { Self { num_wires: 126, @@ -75,6 +76,7 @@ impl CircuitConfig { } } + #[cfg(test)] pub(crate) fn large_zk_config() -> Self { CircuitConfig { zero_knowledge: true, diff --git a/src/polynomial/polynomial.rs b/src/polynomial/polynomial.rs index 055c0813..a0ba214d 100644 --- a/src/polynomial/polynomial.rs +++ b/src/polynomial/polynomial.rs @@ -115,11 +115,11 @@ impl PolynomialCoeffs { /// The number of coefficients. This does not filter out any zero coefficients, so it is not /// necessarily related to the degree. - pub(crate) fn len(&self) -> usize { + pub fn len(&self) -> usize { self.coeffs.len() } - pub(crate) fn log_len(&self) -> usize { + pub fn log_len(&self) -> usize { log2_strict(self.len()) } diff --git a/src/util/mod.rs b/src/util/mod.rs index 8e32dc04..ce796380 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -4,7 +4,7 @@ use crate::polynomial::polynomial::PolynomialValues; pub(crate) mod context_tree; pub(crate) mod marking; pub(crate) mod partial_products; -pub(crate) mod reducing; +pub mod reducing; pub(crate) mod timing; pub(crate) fn bits_u64(n: u64) -> usize { @@ -15,10 +15,6 @@ pub(crate) const fn ceil_div_usize(a: usize, b: usize) -> usize { (a + b - 1) / b } -pub(crate) fn pad_to_multiple_usize(a: usize, b: usize) -> usize { - ceil_div_usize(a, b) * b -} - /// Computes `ceil(log_2(n))`. pub(crate) fn log2_ceil(n: usize) -> usize { n.next_power_of_two().trailing_zeros() as usize diff --git a/src/util/reducing.rs b/src/util/reducing.rs index ca0dd9e8..ac8cdd6a 100644 --- a/src/util/reducing.rs +++ b/src/util/reducing.rs @@ -1,7 +1,7 @@ use std::borrow::Borrow; use crate::field::extension_field::target::ExtensionTarget; -use crate::field::extension_field::{Extendable, Frobenius}; +use crate::field::extension_field::Extendable; use crate::field::field_types::Field; use crate::gates::reducing::ReducingGate; use crate::iop::target::Target; @@ -80,16 +80,6 @@ impl ReducingFactor { pub fn reset(&mut self) { self.count = 0; } - - pub fn repeated_frobenius(&self, count: usize) -> Self - where - F: Frobenius, - { - Self { - base: self.base.repeated_frobenius(count), - count: self.count, - } - } } #[derive(Debug, Clone)] @@ -190,16 +180,6 @@ impl ReducingFactorTarget { pub fn reset(&mut self) { self.count = 0; } - - pub fn repeated_frobenius(&self, count: usize, builder: &mut CircuitBuilder) -> Self - where - F: Extendable, - { - Self { - base: self.base.repeated_frobenius(count, builder), - count: self.count, - } - } } #[cfg(test)]