diff --git a/poly-commit/src/constraints.rs b/poly-commit/src/constraints.rs index 1300509a..a507d80b 100644 --- a/poly-commit/src/constraints.rs +++ b/poly-commit/src/constraints.rs @@ -1,6 +1,6 @@ use crate::{ data_structures::LabeledCommitment, BatchLCProof, LCTerm, LinearCombination, - PCPreparedCommitment, PCPreparedVerifierKey, PolynomialCommitment, String, Vec, + PCPreparedCommitment, PCPreparedVerifierKey, PolynomialCommitment, }; use ark_crypto_primitives::sponge::CryptographicSponge; use ark_ff::PrimeField; @@ -8,7 +8,7 @@ use ark_poly::Polynomial; use ark_r1cs_std::fields::emulated_fp::EmulatedFpVar; use ark_r1cs_std::{fields::fp::FpVar, prelude::*}; use ark_relations::r1cs::{ConstraintSystemRef, Namespace, Result as R1CSResult, SynthesisError}; -use ark_std::{borrow::Borrow, cmp::Eq, cmp::PartialEq, hash::Hash, marker::Sized}; +use ark_std::{borrow::Borrow, cmp::Eq, cmp::PartialEq, hash::Hash}; use hashbrown::{HashMap, HashSet}; /// Define the minimal interface of prepared allocated structures. @@ -94,7 +94,7 @@ pub struct PCCheckRandomDataVar pub trait PCCheckVar< PCF: PrimeField, P: Polynomial, - PC: PolynomialCommitment, + PC: PolynomialCommitment, ConstraintF: PrimeField, S: CryptographicSponge, >: Clone diff --git a/poly-commit/src/data_structures.rs b/poly-commit/src/data_structures.rs index 2b942ee1..c9ab92a8 100644 --- a/poly-commit/src/data_structures.rs +++ b/poly-commit/src/data_structures.rs @@ -1,4 +1,4 @@ -use crate::{Polynomial, String, Vec}; +use crate::Polynomial; use ark_ff::{Field, PrimeField, ToConstraintField}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::rand::RngCore; diff --git a/poly-commit/src/error.rs b/poly-commit/src/error.rs index de7091eb..dcd755a4 100644 --- a/poly-commit/src/error.rs +++ b/poly-commit/src/error.rs @@ -1,5 +1,3 @@ -use crate::String; - /// The error type for `PolynomialCommitment`. #[derive(Debug)] pub enum Error { diff --git a/poly-commit/src/ipa_pc/data_structures.rs b/poly-commit/src/ipa_pc/data_structures.rs index 84fcb7f2..7eb6f1d3 100644 --- a/poly-commit/src/ipa_pc/data_structures.rs +++ b/poly-commit/src/ipa_pc/data_structures.rs @@ -1,10 +1,7 @@ use crate::*; -use crate::{PCCommitterKey, PCVerifierKey, Vec}; use ark_ec::AffineRepr; -use ark_ff::{Field, UniformRand, Zero}; +use ark_ff::{UniformRand, Zero}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; -use ark_std::rand::RngCore; -use ark_std::vec; /// `UniversalParams` are the universal parameters for the inner product arg scheme. #[derive(Derivative, CanonicalSerialize, CanonicalDeserialize)] diff --git a/poly-commit/src/ipa_pc/mod.rs b/poly-commit/src/ipa_pc/mod.rs index 6aab9978..2cb077e4 100644 --- a/poly-commit/src/ipa_pc/mod.rs +++ b/poly-commit/src/ipa_pc/mod.rs @@ -1,4 +1,4 @@ -use crate::{BTreeMap, BTreeSet, String, ToString, Vec, CHALLENGE_SIZE}; +use crate::{BTreeMap, BTreeSet, CHALLENGE_SIZE}; use crate::{BatchLCProof, DenseUVPolynomial, Error, Evaluations, QuerySet}; use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination}; use crate::{PCCommitmentState, PCCommitterKey, PCUniversalParams, PolynomialCommitment}; diff --git a/poly-commit/src/kzg10/data_structures.rs b/poly-commit/src/kzg10/data_structures.rs index d648f19f..f2f970d2 100644 --- a/poly-commit/src/kzg10/data_structures.rs +++ b/poly-commit/src/kzg10/data_structures.rs @@ -2,7 +2,7 @@ use crate::*; use ark_ec::pairing::Pairing; use ark_ec::AdditiveGroup; use ark_ec::AffineRepr; -use ark_ff::{PrimeField, ToConstraintField}; +use ark_ff::ToConstraintField; use ark_serialize::{ CanonicalDeserialize, CanonicalSerialize, Compress, SerializationError, Valid, Validate, }; diff --git a/poly-commit/src/kzg10/mod.rs b/poly-commit/src/kzg10/mod.rs index 508db2cb..1a3fcd66 100644 --- a/poly-commit/src/kzg10/mod.rs +++ b/poly-commit/src/kzg10/mod.rs @@ -5,7 +5,7 @@ //! proposed by Kate, Zaverucha, and Goldberg ([KZG10](http://cacr.uwaterloo.ca/techreports/2010/cacr2010-10.pdf)). //! This construction achieves extractability in the algebraic group model (AGM). -use crate::{BTreeMap, Error, LabeledPolynomial, PCCommitmentState, ToString, Vec}; +use crate::{BTreeMap, Error, LabeledPolynomial, PCCommitmentState}; use ark_ec::AffineRepr; use ark_ec::{pairing::Pairing, CurveGroup}; use ark_ec::{scalar_mul::ScalarMul, VariableBaseMSM}; @@ -479,7 +479,6 @@ mod tests { use ark_bls12_377::Bls12_377; use ark_bls12_381::Bls12_381; use ark_bls12_381::Fr; - use ark_ec::pairing::Pairing; use ark_poly::univariate::DensePolynomial as DensePoly; use ark_std::test_rng; diff --git a/poly-commit/src/lib.rs b/poly-commit/src/lib.rs index f405ba6f..5ad033fa 100644 --- a/poly-commit/src/lib.rs +++ b/poly-commit/src/lib.rs @@ -26,7 +26,6 @@ use ark_std::{ fmt::Debug, hash::Hash, iter::FromIterator, - string::{String, ToString}, vec::Vec, }; @@ -263,7 +262,7 @@ pub trait PolynomialCommitment>: Sized { // order to gather (i.e. batch) all polynomials that should be queried at // the same point, then opening their commitments simultaneously with a // single call to `open` (per point) - let rng = &mut crate::optional_rng::OptionalRng(rng); + let rng = &mut optional_rng::OptionalRng(rng); let poly_st_comm: BTreeMap<_, _> = labeled_polynomials .into_iter() .zip(states) @@ -622,7 +621,6 @@ fn lc_query_set_to_poly_query_set<'a, F: Field, T: Clone + Ord>( pub mod tests { use crate::*; use ark_crypto_primitives::sponge::poseidon::{PoseidonConfig, PoseidonSponge}; - use ark_poly::Polynomial; use ark_std::rand::{ distributions::{Distribution, Uniform}, Rng, SeedableRng, diff --git a/poly-commit/src/marlin/marlin_pc/data_structures.rs b/poly-commit/src/marlin/marlin_pc/data_structures.rs index 203e3201..4bb761f8 100644 --- a/poly-commit/src/marlin/marlin_pc/data_structures.rs +++ b/poly-commit/src/marlin/marlin_pc/data_structures.rs @@ -1,6 +1,6 @@ use crate::{ DenseUVPolynomial, PCCommitment, PCCommitmentState, PCCommitterKey, PCPreparedCommitment, - PCPreparedVerifierKey, PCVerifierKey, Vec, + PCPreparedVerifierKey, PCVerifierKey, }; use ark_ec::pairing::Pairing; use ark_ec::AdditiveGroup; diff --git a/poly-commit/src/marlin/marlin_pc/mod.rs b/poly-commit/src/marlin/marlin_pc/mod.rs index 2549db61..673aca44 100644 --- a/poly-commit/src/marlin/marlin_pc/mod.rs +++ b/poly-commit/src/marlin/marlin_pc/mod.rs @@ -1,5 +1,5 @@ use crate::{kzg10, marlin::Marlin, PCCommitterKey, CHALLENGE_SIZE}; -use crate::{BTreeMap, BTreeSet, ToString, Vec}; +use crate::{BTreeMap, BTreeSet}; use crate::{BatchLCProof, Error, Evaluations, QuerySet}; use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination}; use crate::{PCCommitmentState, PCUniversalParams, PolynomialCommitment}; diff --git a/poly-commit/src/marlin/marlin_pst13_pc/combinations.rs b/poly-commit/src/marlin/marlin_pst13_pc/combinations.rs index dd1aaf14..808038cf 100644 --- a/poly-commit/src/marlin/marlin_pst13_pc/combinations.rs +++ b/poly-commit/src/marlin/marlin_pst13_pc/combinations.rs @@ -1,6 +1,5 @@ //! Compute all combinations of values in a given list //! Credit: https://github.com/meltinglava/uniquecombinations/ -use crate::Vec; /// Compute all combinations of values in a given list. pub(crate) struct Combinations diff --git a/poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs b/poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs index 9cc8d73b..3b606702 100644 --- a/poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs +++ b/poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs @@ -1,4 +1,4 @@ -use crate::{BTreeMap, Vec}; +use crate::BTreeMap; use crate::{ PCCommitmentState, PCCommitterKey, PCPreparedVerifierKey, PCUniversalParams, PCVerifierKey, }; diff --git a/poly-commit/src/marlin/marlin_pst13_pc/mod.rs b/poly-commit/src/marlin/marlin_pst13_pc/mod.rs index 57c0a56b..4752f7d4 100644 --- a/poly-commit/src/marlin/marlin_pst13_pc/mod.rs +++ b/poly-commit/src/marlin/marlin_pst13_pc/mod.rs @@ -6,7 +6,6 @@ use crate::{ use crate::{BatchLCProof, Error, Evaluations, QuerySet}; use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination}; use crate::{PCCommitmentState, PCUniversalParams, PolynomialCommitment}; -use crate::{ToString, Vec}; use ark_ec::AffineRepr; use ark_ec::{ pairing::Pairing, @@ -706,7 +705,6 @@ mod tests { multivariate::{SparsePolynomial as SparsePoly, SparseTerm}, DenseMVPolynomial, }; - use ark_std::vec::Vec; use rand_chacha::ChaCha20Rng; type MVPoly_381 = SparsePoly<::ScalarField, SparseTerm>; diff --git a/poly-commit/src/marlin/mod.rs b/poly-commit/src/marlin/mod.rs index 8a1e3976..1507ae06 100644 --- a/poly-commit/src/marlin/mod.rs +++ b/poly-commit/src/marlin/mod.rs @@ -1,6 +1,6 @@ use crate::CHALLENGE_SIZE; use crate::{kzg10, Error}; -use crate::{BTreeMap, BTreeSet, Debug, RngCore, String, ToString, Vec}; +use crate::{BTreeMap, BTreeSet, Debug, RngCore}; use crate::{BatchLCProof, LabeledPolynomial, LinearCombination}; use crate::{Evaluations, LabeledCommitment, QuerySet}; use crate::{PCCommitmentState, Polynomial, PolynomialCommitment}; diff --git a/poly-commit/src/multilinear_pc/data_structures.rs b/poly-commit/src/multilinear_pc/data_structures.rs index 6920ece7..760c2869 100644 --- a/poly-commit/src/multilinear_pc/data_structures.rs +++ b/poly-commit/src/multilinear_pc/data_structures.rs @@ -1,6 +1,5 @@ use ark_ec::pairing::Pairing; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; -use ark_std::vec::Vec; #[allow(type_alias_bounds)] /// Evaluations over {0,1}^n for G1 pub type EvaluationHyperCubeOnG1 = Vec; diff --git a/poly-commit/src/multilinear_pc/mod.rs b/poly-commit/src/multilinear_pc/mod.rs index cff20eb5..4822d248 100644 --- a/poly-commit/src/multilinear_pc/mod.rs +++ b/poly-commit/src/multilinear_pc/mod.rs @@ -13,7 +13,6 @@ use ark_std::iter::FromIterator; use ark_std::marker::PhantomData; use ark_std::ops::Mul; use ark_std::rand::RngCore; -use ark_std::vec::Vec; use ark_std::UniformRand; /// data structures used by multilinear extension commitment scheme @@ -244,7 +243,6 @@ mod tests { use ark_poly::{DenseMultilinearExtension, MultilinearExtension, SparseMultilinearExtension}; use ark_std::rand::RngCore; use ark_std::test_rng; - use ark_std::vec::Vec; type E = Bls12_381; type Fr = ::ScalarField; diff --git a/poly-commit/src/sonic_pc/data_structures.rs b/poly-commit/src/sonic_pc/data_structures.rs index 4e1cd309..3f2267c9 100644 --- a/poly-commit/src/sonic_pc/data_structures.rs +++ b/poly-commit/src/sonic_pc/data_structures.rs @@ -1,6 +1,6 @@ use crate::kzg10; use crate::{ - BTreeMap, PCCommitterKey, PCPreparedCommitment, PCPreparedVerifierKey, PCVerifierKey, Vec, + BTreeMap, PCCommitterKey, PCPreparedCommitment, PCPreparedVerifierKey, PCVerifierKey, }; use ark_ec::pairing::Pairing; use ark_ec::AdditiveGroup; diff --git a/poly-commit/src/sonic_pc/mod.rs b/poly-commit/src/sonic_pc/mod.rs index 95d67272..61ed8362 100644 --- a/poly-commit/src/sonic_pc/mod.rs +++ b/poly-commit/src/sonic_pc/mod.rs @@ -1,5 +1,5 @@ use crate::{kzg10, PCCommitterKey, CHALLENGE_SIZE}; -use crate::{BTreeMap, BTreeSet, String, ToString, Vec}; +use crate::{BTreeMap, BTreeSet}; use crate::{BatchLCProof, DenseUVPolynomial, Error, Evaluations, QuerySet}; use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination}; use crate::{PCCommitmentState, PCUniversalParams, PolynomialCommitment}; diff --git a/poly-commit/src/streaming_kzg/data_structures.rs b/poly-commit/src/streaming_kzg/data_structures.rs index 0dc68e87..43a9ec29 100644 --- a/poly-commit/src/streaming_kzg/data_structures.rs +++ b/poly-commit/src/streaming_kzg/data_structures.rs @@ -1,6 +1,5 @@ use ark_ff::Field; use ark_std::borrow::Borrow; -use ark_std::vec::Vec; use crate::streaming_kzg::ceil_div; use ark_std::iterable::Iterable; diff --git a/poly-commit/src/streaming_kzg/mod.rs b/poly-commit/src/streaming_kzg/mod.rs index e3bdb2af..ff0ee6e1 100644 --- a/poly-commit/src/streaming_kzg/mod.rs +++ b/poly-commit/src/streaming_kzg/mod.rs @@ -88,7 +88,6 @@ mod time; use ark_ec::CurveGroup; use ark_serialize::{CanonicalSerialize, Compress}; -use ark_std::vec::Vec; pub use data_structures::*; pub use space::CommitterKeyStream; pub use time::CommitterKey; diff --git a/poly-commit/src/streaming_kzg/space.rs b/poly-commit/src/streaming_kzg/space.rs index ab50adfd..e8ac3d21 100644 --- a/poly-commit/src/streaming_kzg/space.rs +++ b/poly-commit/src/streaming_kzg/space.rs @@ -4,7 +4,6 @@ use ark_ff::{PrimeField, Zero}; use ark_poly::Polynomial; use ark_std::borrow::Borrow; use ark_std::collections::VecDeque; -use ark_std::vec::Vec; use crate::streaming_kzg::{ceil_div, vanishing_polynomial, FoldedPolynomialTree}; use ark_ec::scalar_mul::variable_base::{ChunkedPippenger, HashMapPippenger, VariableBaseMSM}; diff --git a/poly-commit/src/streaming_kzg/tests.rs b/poly-commit/src/streaming_kzg/tests.rs index bb2aa34e..c399cef7 100644 --- a/poly-commit/src/streaming_kzg/tests.rs +++ b/poly-commit/src/streaming_kzg/tests.rs @@ -1,7 +1,6 @@ use ark_bls12_381::{Bls12_381, Fr}; use ark_poly::univariate::DensePolynomial; use ark_poly::DenseUVPolynomial; -use ark_std::vec::Vec; use ark_std::{UniformRand, Zero}; use crate::streaming_kzg::space::CommitterKeyStream; diff --git a/poly-commit/src/streaming_kzg/time.rs b/poly-commit/src/streaming_kzg/time.rs index b8d52093..b6aa3d14 100644 --- a/poly-commit/src/streaming_kzg/time.rs +++ b/poly-commit/src/streaming_kzg/time.rs @@ -5,7 +5,7 @@ use ark_ec::scalar_mul::ScalarMul; use ark_ec::CurveGroup; use ark_ff::Zero; use ark_poly::{univariate::DensePolynomial, DenseUVPolynomial}; -use ark_std::{borrow::Borrow, ops::Div, ops::Mul, rand::RngCore, vec::Vec, UniformRand}; +use ark_std::{borrow::Borrow, ops::Div, ops::Mul, rand::RngCore, UniformRand}; use crate::streaming_kzg::{ linear_combination, msm, powers, Commitment, EvaluationProof, VerifierKey,