Skip to content

Commit

Permalink
clean up all imports
Browse files Browse the repository at this point in the history
clean up imports acc to nightly

Revert "dont need to use full path"

This reverts commit b272524abeaa9f7d6697539f22682bc081e3e8a5.

more fmt
  • Loading branch information
mmagician committed Mar 11, 2024
1 parent 53d161b commit 38ca957
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 31 deletions.
4 changes: 3 additions & 1 deletion poly-commit/src/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::{Polynomial, String, Vec};
use crate::Polynomial;
use ark_ff::{Field, PrimeField, ToConstraintField};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::rand::RngCore;
use ark_std::string::*;
use ark_std::vec::*;
use ark_std::{
borrow::Borrow,
marker::PhantomData,
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::String;
use ark_std::string::*;

/// The error type for `PolynomialCommitment`.
#[derive(Debug)]
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
4 changes: 3 additions & 1 deletion poly-commit/src/ipa_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
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};
use ark_std::string::*;
use ark_std::vec::*;

use ark_ec::{AffineRepr, CurveGroup, VariableBaseMSM};
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
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
4 changes: 3 additions & 1 deletion poly-commit/src/kzg10/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
//! 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};
use ark_ff::{One, PrimeField, UniformRand, Zero};
use ark_poly::DenseUVPolynomial;
use ark_std::string::*;
use ark_std::vec::*;
use ark_std::{format, marker::PhantomData, ops::Div, ops::Mul, vec};

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

/// Data structures used by a polynomial commitment scheme.
Expand Down Expand Up @@ -263,7 +263,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
3 changes: 2 additions & 1 deletion poly-commit/src/marlin/marlin_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use crate::{
DenseUVPolynomial, PCCommitment, PCCommitmentState, PCCommitterKey, PCPreparedCommitment,
PCPreparedVerifierKey, PCVerifierKey, Vec,
PCPreparedVerifierKey, PCVerifierKey,
};
use ark_ec::pairing::Pairing;
use ark_ec::AdditiveGroup;
use ark_ff::{Field, PrimeField, ToConstraintField};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::ops::{Add, AddAssign};
use ark_std::rand::RngCore;
use ark_std::vec::*;

use crate::kzg10;
/// `UniversalParams` are the universal parameters for the KZG10 scheme.
Expand Down
5 changes: 4 additions & 1 deletion poly-commit/src/marlin/marlin_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::{kzg10, marlin::Marlin, PCCommitterKey, CHALLENGE_SIZE};
use crate::{BTreeMap, BTreeSet, ToString, Vec};
use crate::{BTreeMap, BTreeSet};
use ark_std::string::*;
use ark_std::vec::*;

use crate::{BatchLCProof, Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination};
use crate::{PCCommitmentState, PCUniversalParams, PolynomialCommitment};
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/marlin_pst13_pc/combinations.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Compute all combinations of values in a given list
//! Credit: https://github.com/meltinglava/uniquecombinations/
use crate::Vec;
use ark_std::vec::*;

/// Compute all combinations of values in a given list.
pub(crate) struct Combinations<T>
Expand Down
3 changes: 2 additions & 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 All @@ -14,6 +14,7 @@ use ark_serialize::{
CanonicalDeserialize, CanonicalSerialize, Compress, SerializationError, Valid, Validate,
};
use ark_std::rand::RngCore;
use ark_std::vec::*;

/// `UniversalParams` are the universal parameters for the MarlinPST13 scheme.
#[derive(Derivative)]
Expand Down
5 changes: 3 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 All @@ -16,6 +15,8 @@ use ark_ec::{
use ark_ff::{One, PrimeField, UniformRand, Zero};
use ark_poly::{multivariate::Term, DenseMVPolynomial};
use ark_std::rand::RngCore;
use ark_std::string::*;
use ark_std::vec::*;
use ark_std::{marker::PhantomData, ops::Index, ops::Mul, vec};

mod data_structures;
Expand Down Expand Up @@ -706,7 +707,7 @@ mod tests {
multivariate::{SparsePolynomial as SparsePoly, SparseTerm},
DenseMVPolynomial,
};
use ark_std::vec::Vec;
use ark_std::vec::*;
use rand_chacha::ChaCha20Rng;

type MVPoly_381 = SparsePoly<<Bls12_381 as Pairing>::ScalarField, SparseTerm>;
Expand Down
4 changes: 3 additions & 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 All @@ -9,6 +9,8 @@ use ark_ec::pairing::Pairing;
use ark_ec::AffineRepr;
use ark_ec::CurveGroup;
use ark_ff::{One, Zero};
use ark_std::string::*;
use ark_std::vec::*;
use ark_std::{convert::TryInto, hash::Hash, ops::AddAssign, ops::Mul};

/// Polynomial commitment scheme from [[KZG10]][kzg] that enforces
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/multilinear_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_ec::pairing::Pairing;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
use ark_std::vec::*;
#[allow(type_alias_bounds)]
/// Evaluations over {0,1}^n for G1
pub type EvaluationHyperCubeOnG1<E: Pairing> = Vec<E::G1Affine>;
Expand Down
4 changes: 2 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,7 @@ 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::vec::*;
use ark_std::UniformRand;

/// data structures used by multilinear extension commitment scheme
Expand Down Expand Up @@ -244,7 +244,7 @@ mod tests {
use ark_poly::{DenseMultilinearExtension, MultilinearExtension, SparseMultilinearExtension};
use ark_std::rand::RngCore;
use ark_std::test_rng;
use ark_std::vec::Vec;
use ark_std::vec::*;
type E = Bls12_381;
type Fr = <E as Pairing>::ScalarField;

Expand Down
5 changes: 2 additions & 3 deletions poly-commit/src/sonic_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use crate::kzg10;
use crate::{
BTreeMap, PCCommitterKey, PCPreparedCommitment, PCPreparedVerifierKey, PCVerifierKey, Vec,
};
use crate::{BTreeMap, PCCommitterKey, PCPreparedCommitment, PCPreparedVerifierKey, PCVerifierKey};
use ark_ec::pairing::Pairing;
use ark_ec::AdditiveGroup;
use ark_serialize::{
CanonicalDeserialize, CanonicalSerialize, Compress, SerializationError, Valid, Validate,
};
use ark_std::io::{Read, Write};
use ark_std::vec::*;

/// `UniversalParams` are the universal parameters for the KZG10 scheme.
pub type UniversalParams<E> = kzg10::UniversalParams<E>;
Expand Down
4 changes: 3 additions & 1 deletion poly-commit/src/sonic_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
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};
use ark_ec::AffineRepr;
use ark_ec::CurveGroup;
use ark_std::string::*;
use ark_std::vec::*;

use ark_ec::pairing::Pairing;
use ark_ff::{One, UniformRand, Zero};
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/streaming_kzg/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_ff::Field;
use ark_std::borrow::Borrow;
use ark_std::vec::Vec;
use ark_std::vec::*;

use crate::streaming_kzg::ceil_div;
use ark_std::iterable::Iterable;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/streaming_kzg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mod time;

use ark_ec::CurveGroup;
use ark_serialize::{CanonicalSerialize, Compress};
use ark_std::vec::Vec;
use ark_std::vec::*;
pub use data_structures::*;
pub use space::CommitterKeyStream;
pub use time::CommitterKey;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/streaming_kzg/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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 ark_std::vec::*;

use crate::streaming_kzg::{ceil_div, vanishing_polynomial, FoldedPolynomialTree};
use ark_ec::scalar_mul::variable_base::{ChunkedPippenger, HashMapPippenger, VariableBaseMSM};
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/streaming_kzg/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ark_bls12_381::{Bls12_381, Fr};
use ark_poly::univariate::DensePolynomial;
use ark_poly::DenseUVPolynomial;
use ark_std::vec::Vec;
use ark_std::vec::*;
use ark_std::{UniformRand, Zero};

use crate::streaming_kzg::space::CommitterKeyStream;
Expand Down
3 changes: 2 additions & 1 deletion poly-commit/src/streaming_kzg/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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::vec::*;
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 38ca957

Please sign in to comment.