diff --git a/examples/hashchain.rs b/examples/hashchain.rs index 3f6ffdb42..10c0383ec 100644 --- a/examples/hashchain.rs +++ b/examples/hashchain.rs @@ -92,9 +92,9 @@ impl StepCircuit for HashChainCircuit { let acc = &mut ns; sponge.start(parameter, None, acc); - neptune::sponge::api::SpongeAPI::absorb(&mut sponge, num_absorbs, &elt, acc); + SpongeAPI::absorb(&mut sponge, num_absorbs, &elt, acc); - let output = neptune::sponge::api::SpongeAPI::squeeze(&mut sponge, 1, acc); + let output = SpongeAPI::squeeze(&mut sponge, 1, acc); sponge.finish(acc).unwrap(); Elt::ensure_allocated(&output[0], &mut ns.namespace(|| "ensure allocated"), true)? }; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 36d6d232b..e4205e80b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. profile = "default" -channel = "1.77" +channel = "1.78" targets = [ "wasm32-unknown-unknown" ] diff --git a/src/gadgets/nonnative/mod.rs b/src/gadgets/nonnative/mod.rs index 8167e5a7e..4d611cbb0 100644 --- a/src/gadgets/nonnative/mod.rs +++ b/src/gadgets/nonnative/mod.rs @@ -6,16 +6,12 @@ use ff::PrimeField; trait OptionExt { fn grab(&self) -> Result<&T, SynthesisError>; - fn grab_mut(&mut self) -> Result<&mut T, SynthesisError>; } impl OptionExt for Option { fn grab(&self) -> Result<&T, SynthesisError> { self.as_ref().ok_or(SynthesisError::AssignmentMissing) } - fn grab_mut(&mut self) -> Result<&mut T, SynthesisError> { - self.as_mut().ok_or(SynthesisError::AssignmentMissing) - } } trait BitAccess { diff --git a/src/provider/poseidon.rs b/src/provider/poseidon.rs index 3a42bf4a9..de4e8b298 100644 --- a/src/provider/poseidon.rs +++ b/src/provider/poseidon.rs @@ -169,7 +169,7 @@ where assert_eq!(self.num_absorbs, self.state.len()); sponge.start(parameter, None, acc); - neptune::sponge::api::SpongeAPI::absorb( + SpongeAPI::absorb( &mut sponge, self.num_absorbs as u32, &(0..self.state.len()) @@ -178,7 +178,7 @@ where acc, ); - let output = neptune::sponge::api::SpongeAPI::squeeze(&mut sponge, 1, acc); + let output = SpongeAPI::squeeze(&mut sponge, 1, acc); sponge.finish(acc).unwrap(); output }; diff --git a/src/provider/tests/mod.rs b/src/provider/tests/mod.rs index 6f2858161..7a473c50f 100644 --- a/src/provider/tests/mod.rs +++ b/src/provider/tests/mod.rs @@ -25,7 +25,7 @@ pub mod solidity_compatibility_utils { ) { use rand_core::SeedableRng; - let mut rng = rand::rngs::StdRng::seed_from_u64(num_vars as u64); + let mut rng = StdRng::seed_from_u64(num_vars as u64); let (poly, point, eval) = crate::provider::util::test_utils::random_poly_with_eval::(num_vars, &mut rng); diff --git a/src/provider/util/mod.rs b/src/provider/util/mod.rs index bff8340f1..44eabf14d 100644 --- a/src/provider/util/mod.rs +++ b/src/provider/util/mod.rs @@ -146,7 +146,7 @@ pub mod test_utils { ) { use rand_core::SeedableRng; - let mut rng = rand::rngs::StdRng::seed_from_u64(num_vars as u64); + let mut rng = StdRng::seed_from_u64(num_vars as u64); let (poly, point, eval) = random_poly_with_eval::(num_vars, &mut rng); diff --git a/src/spartan/math.rs b/src/spartan/math.rs index 4a879b93d..94b35c50f 100644 --- a/src/spartan/math.rs +++ b/src/spartan/math.rs @@ -1,23 +1,8 @@ pub trait Math { - fn pow2(self) -> usize; - fn get_bits(self, num_bits: usize) -> Vec; fn log_2(self) -> usize; } impl Math for usize { - #[inline] - fn pow2(self) -> usize { - let base: Self = 2; - base.pow(self as u32) - } - - /// Returns the `num_bits` from n in a canonical order - fn get_bits(self, num_bits: usize) -> Vec { - (0..num_bits) - .map(|shift_amount| ((self & (1 << (num_bits - shift_amount - 1))) > 0)) - .collect::>() - } - fn log_2(self) -> usize { assert_ne!(self, 0); diff --git a/src/spartan/polys/multilinear.rs b/src/spartan/polys/multilinear.rs index a4817ccdf..7ce2047c8 100644 --- a/src/spartan/polys/multilinear.rs +++ b/src/spartan/polys/multilinear.rs @@ -181,7 +181,7 @@ impl Add for MultilinearPolynomial { #[cfg(test)] mod tests { - use crate::provider::{self, bn256_grumpkin::bn256, secp_secq::secp256k1}; + use crate::provider::{bn256_grumpkin::bn256, secp_secq::secp256k1}; use super::*; use rand_chacha::ChaCha20Rng; @@ -293,8 +293,8 @@ mod tests { #[test] fn test_evaluation() { test_evaluation_with::(); - test_evaluation_with::(); - test_evaluation_with::(); + test_evaluation_with::(); + test_evaluation_with::(); } /// This binds the variables of a multilinear polynomial to a provided sequence diff --git a/src/supernova/mod.rs b/src/supernova/mod.rs index 92df409c0..347f2c25a 100644 --- a/src/supernova/mod.rs +++ b/src/supernova/mod.rs @@ -1155,19 +1155,6 @@ where fn secondary_circuit(&self) -> Self::C2; } -/// Extension trait to simplify getting scalar form of initial circuit index. -trait InitialProgramCounter: NonUniformCircuit -where - E1: CurveCycleEquipped, -{ - /// Initial program counter is the initial circuit index as a `Scalar`. - fn initial_program_counter(&self) -> E1::Scalar { - E1::Scalar::from(self.initial_circuit_index() as u64) - } -} - -impl> InitialProgramCounter for T {} - /// Compute the circuit digest of a supernova [`StepCircuit`]. /// /// Note for callers: This function should be called with its performance characteristics in mind.