Skip to content

Commit

Permalink
Remove redundant imports according to nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
autquis committed Mar 11, 2024
1 parent 53d161b commit 1a2b497
Show file tree
Hide file tree
Showing 23 changed files with 16 additions and 34 deletions.
6 changes: 3 additions & 3 deletions poly-commit/src/constraints.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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;
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.
Expand Down Expand Up @@ -94,7 +94,7 @@ pub struct PCCheckRandomDataVar<TargetField: PrimeField, BaseField: PrimeField>
pub trait PCCheckVar<
PCF: PrimeField,
P: Polynomial<PCF>,
PC: PolynomialCommitment<PCF, P, S>,
PC: PolynomialCommitment<PCF, P>,
ConstraintF: PrimeField,
S: CryptographicSponge,
>: Clone
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/data_structures.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 0 additions & 2 deletions poly-commit/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::String;

/// The error type for `PolynomialCommitment`.
#[derive(Debug)]
pub enum Error {
Expand Down
5 changes: 1 addition & 4 deletions poly-commit/src/ipa_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/ipa_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/kzg10/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
3 changes: 1 addition & 2 deletions poly-commit/src/kzg10/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 1 addition & 3 deletions poly-commit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use ark_std::{
fmt::Debug,
hash::Hash,
iter::FromIterator,
string::{String, ToString},
vec::Vec,
};

Expand Down Expand Up @@ -263,7 +262,7 @@ pub trait PolynomialCommitment<F: PrimeField, P: Polynomial<F>>: 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)
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/marlin_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/marlin_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/marlin/marlin_pst13_pc/combinations.rs
Original file line number Diff line number Diff line change
@@ -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<T>
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BTreeMap, Vec};
use crate::BTreeMap;
use crate::{
PCCommitmentState, PCCommitterKey, PCPreparedVerifierKey, PCUniversalParams, PCVerifierKey,
};
Expand Down
2 changes: 0 additions & 2 deletions poly-commit/src/marlin/marlin_pst13_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<<Bls12_381 as Pairing>::ScalarField, SparseTerm>;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/multilinear_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -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<E: Pairing> = Vec<E::G1Affine>;
Expand Down
2 changes: 0 additions & 2 deletions poly-commit/src/multilinear_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = <E as Pairing>::ScalarField;

Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/sonic_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/sonic_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/data_structures.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/tests.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/streaming_kzg/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1a2b497

Please sign in to comment.