Skip to content

Commit

Permalink
fix: glob imports (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker authored Aug 8, 2023
1 parent bdabff5 commit 68d0828
Show file tree
Hide file tree
Showing 39 changed files with 82 additions and 53 deletions.
5 changes: 4 additions & 1 deletion ec/src/hashing/map_to_curve_hasher.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::{hashing::*, AffineRepr, CurveGroup};
use crate::{
hashing::{HashToCurve, HashToCurveError},
AffineRepr, CurveGroup,
};
use ark_ff::field_hashers::HashToField;
use ark_std::marker::PhantomData;

Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/bls12/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
short_weierstrass::{Affine, Projective},
AffineRepr, CurveGroup,
};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;

pub type G1Affine<P> = Affine<<P as Bls12Config>::G1Config>;
Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/bls12/g2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ark_ff::{AdditiveGroup, BitIteratorBE, Field, Fp2};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::{vec::Vec, One};

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/bn/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
short_weierstrass::{Affine, Projective},
AffineRepr, CurveGroup,
};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;

pub type G1Affine<P> = Affine<<P as BnConfig>::G1Config>;
Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/bn/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ark_ff::{
fields::{Field, Fp2},
AdditiveGroup,
};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
use num_traits::One;

Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/bw6/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
short_weierstrass::{Affine, Projective},
AffineRepr, CurveGroup,
};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;

pub type G1Affine<P> = Affine<<P as BW6Config>::G1Config>;
Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/bw6/g2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ark_ff::{AdditiveGroup, BitIteratorBE, Field};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
use num_traits::One;

Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/mnt4/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
AffineRepr, CurveGroup,
};
use ark_ff::Fp2;
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;

pub type G1Affine<P> = Affine<<P as MNT4Config>::G1Config>;
Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/mnt4/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
AffineRepr, CurveGroup,
};
use ark_ff::fields::{Field, Fp2};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
use num_traits::One;

Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/mnt6/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
AffineRepr, CurveGroup,
};
use ark_ff::Fp3;
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;

pub type G1Affine<P> = Affine<<P as MNT6Config>::G1Config>;
Expand Down
2 changes: 1 addition & 1 deletion ec/src/models/mnt6/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
AffineRepr, CurveGroup,
};
use ark_ff::fields::{Field, Fp3};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::{ops::Neg, vec::Vec};
use num_traits::One;

Expand Down
2 changes: 1 addition & 1 deletion ff-asm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use syn::{
};

mod context;
use context::*;
use context::{AssemblyVar, Context};

use std::cell::RefCell;

Expand Down
12 changes: 6 additions & 6 deletions ff-macros/src/montgomery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ use num_bigint::BigUint;
use num_traits::One;

mod biginteger;
use biginteger::*;
use biginteger::{add_with_carry_impl, sub_with_borrow_impl, subtract_modulus_impl};

mod add;
use add::*;
use add::add_assign_impl;
mod double;
use double::*;
use double::double_in_place_impl;
mod mul;
use mul::*;
use mul::mul_assign_impl;

mod square;
use square::*;
use square::square_in_place_impl;

mod sum_of_products;
use sum_of_products::*;
use sum_of_products::sum_of_products_impl;

use crate::utils;

Expand Down
7 changes: 5 additions & 2 deletions ff/src/fields/models/fp12_2over3over2.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use ark_std::Zero;

use super::quadratic_extension::*;
use super::quadratic_extension::{QuadExtConfig, QuadExtField};
use crate::{
fields::{fp6_3over2::*, Field, Fp2, Fp2Config as Fp2ConfigTrait},
fields::{
fp6_3over2::{Fp6, Fp6Config},
Field, Fp2, Fp2Config as Fp2ConfigTrait,
},
AdditiveGroup, CyclotomicMultSubgroup,
};
use core::{
Expand Down
2 changes: 1 addition & 1 deletion ff/src/fields/models/fp2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_std::Zero;

use super::quadratic_extension::*;
use super::quadratic_extension::{QuadExtConfig, QuadExtField};
use crate::{fields::PrimeField, CyclotomicMultSubgroup};
use core::{marker::PhantomData, ops::Not};

Expand Down
4 changes: 2 additions & 2 deletions ff/src/fields/models/fp3.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::cubic_extension::*;
use crate::fields::*;
use super::cubic_extension::{CubicExtConfig, CubicExtField};
use crate::fields::{CyclotomicMultSubgroup, MulAssign, PrimeField, SqrtPrecomputation};
use core::marker::PhantomData;

/// Trait that specifies constants and methods for defining degree-three extension fields.
Expand Down
2 changes: 1 addition & 1 deletion ff/src/fields/models/fp4.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_std::Zero;

use super::quadratic_extension::*;
use super::quadratic_extension::{QuadExtConfig, QuadExtField};
use core::{marker::PhantomData, ops::Not};

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion ff/src/fields/models/fp6_2over3.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_std::Zero;

use super::quadratic_extension::*;
use super::quadratic_extension::{QuadExtConfig, QuadExtField};
use core::{
marker::PhantomData,
ops::{MulAssign, Not},
Expand Down
6 changes: 4 additions & 2 deletions ff/src/fields/models/fp6_3over2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::cubic_extension::*;
use crate::fields::*;
use super::cubic_extension::{CubicExtConfig, CubicExtField};
use crate::fields::{
AddAssign, CyclotomicMultSubgroup, Fp2, Fp2Config, MulAssign, SqrtPrecomputation, SubAssign,
};
use core::marker::PhantomData;

pub trait Fp6Config: 'static + Send + Sync + Copy {
Expand Down
6 changes: 5 additions & 1 deletion poly/src/domain/radix2/fft.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// The code below is a port of the excellent library of https://github.com/kwantam/fffft by Riad S. Wahby
// to the arkworks APIs

use crate::domain::{radix2::*, utils::compute_powers_serial, DomainCoeff};
use crate::domain::{
radix2::{fft, EvaluationDomain, Radix2EvaluationDomain},
utils::compute_powers_serial,
DomainCoeff,
};
use ark_ff::FftField;
use ark_std::{cfg_chunks_mut, vec::Vec};
#[cfg(feature = "parallel")]
Expand Down
2 changes: 1 addition & 1 deletion poly/src/polynomial/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Modules for working with univariate or multivariate polynomials.
use ark_ff::{Field, Zero};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::{
fmt::Debug,
hash::Hash,
Expand Down
2 changes: 1 addition & 1 deletion poly/src/polynomial/univariate/dense.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
DenseUVPolynomial, EvaluationDomain, Evaluations, GeneralEvaluationDomain, Polynomial,
};
use ark_ff::{FftField, Field, Zero};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::{
fmt,
ops::{Add, AddAssign, Deref, DerefMut, Div, Mul, Neg, Sub, SubAssign},
Expand Down
4 changes: 2 additions & 2 deletions serialize-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
use syn::{parse_macro_input, DeriveInput};

mod serialize;
use serialize::*;
use serialize::impl_canonical_serialize;

mod deserialize;
use deserialize::*;
use deserialize::impl_canonical_deserialize;

#[proc_macro_derive(CanonicalSerialize)]
pub fn derive_canonical_serialize(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
Expand Down
5 changes: 4 additions & 1 deletion serialize/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use ark_std::{
};
use num_bigint::BigUint;

use crate::*;
use crate::{
CanonicalDeserialize, CanonicalSerialize, Compress, SerializationError, ToOwned, Valid,
Validate,
};

impl Valid for bool {
fn check(&self) -> Result<(), SerializationError> {
Expand Down
2 changes: 1 addition & 1 deletion test-curves/benches/bls12_381.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ark_algebra_bench_templates::*;
use ark_algebra_bench_templates::{bench, criterion_main, field_common, paste, prime_field, sqrt};
use ark_test_curves::bls12_381::{
fq::Fq, fq2::Fq2, fr::Fr, Bls12_381, Fq12, G1Projective as G1, G2Projective as G2,
};
Expand Down
2 changes: 1 addition & 1 deletion test-curves/benches/bn384_small_two_adicity.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ark_algebra_bench_templates::*;
use ark_algebra_bench_templates::{bench, criterion_main, field_common, paste, prime_field, sqrt};
use ark_test_curves::bn384_small_two_adicity::{fq::Fq, fr::Fr, G1Projective as G1};

bench!(Name = "BN384", Group = G1, ScalarField = Fr, BaseField = Fq,);
2 changes: 1 addition & 1 deletion test-curves/benches/ed_on_bls12_381.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ark_algebra_bench_templates::*;
use ark_algebra_bench_templates::{bench, criterion_main, field_common, paste, prime_field, sqrt};
use ark_test_curves::ed_on_bls12_381::{Fq, Fr, Projective};

bench!(
Expand Down
2 changes: 1 addition & 1 deletion test-curves/benches/mnt4_753.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ark_algebra_bench_templates::*;
use ark_algebra_bench_templates::{bench, criterion_main, field_common, paste, prime_field, sqrt};
use ark_test_curves::mnt4_753::{fq::Fq, fr::Fr, G1Projective as G1};

bench!(
Expand Down
7 changes: 5 additions & 2 deletions test-curves/src/bls12_381/fq12.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::bls12_381::*;
use ark_ff::{fields::*, MontFp};
use crate::bls12_381::{Fq2, Fq6, Fq6Config, FQ2_ONE, FQ2_ZERO};
use ark_ff::{
fields::{Fp12, Fp12Config, Fp2},
MontFp,
};

pub type Fq12 = Fp12<Fq12Config>;

Expand Down
7 changes: 5 additions & 2 deletions test-curves/src/bls12_381/fq2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::bls12_381::*;
use ark_ff::{fields::*, MontFp};
use crate::bls12_381::{Fq, FQ_ONE, FQ_ZERO};
use ark_ff::{
fields::{AdditiveGroup, Fp2, Fp2Config},
MontFp,
};

pub type Fq2 = Fp2<Fq2Config>;

Expand Down
7 changes: 5 additions & 2 deletions test-curves/src/bls12_381/fq6.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::bls12_381::*;
use ark_ff::{fields::*, MontFp};
use crate::bls12_381::{Fq2, Fq2Config};
use ark_ff::{
fields::{Fp6, Fp6Config},
MontFp,
};

pub type Fq6 = Fp6<Fq6Config>;

Expand Down
4 changes: 2 additions & 2 deletions test-curves/src/bls12_381/g1.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::bls12_381::*;
use crate::bls12_381::{g1_swu_iso, Fq, Fr};
use ark_ec::{
hashing::curve_maps::wb::{IsogenyMap, WBConfig},
models::CurveConfig,
scalar_mul::glv::GLVConfig,
short_weierstrass::{self, *},
short_weierstrass::{self, Affine, Projective},
};
use ark_ff::{BigInt, MontFp, PrimeField, Zero};

Expand Down
2 changes: 1 addition & 1 deletion test-curves/src/bls12_381/g1_swu_iso.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::bls12_381::*;
use crate::bls12_381::{g1, Fq, Fr};
use ark_ec::{
hashing::curve_maps::{swu::SWUConfig, wb::IsogenyMap},
models::{
Expand Down
4 changes: 2 additions & 2 deletions test-curves/src/bls12_381/g2.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use core::ops::Neg;

use crate::bls12_381::*;
use crate::bls12_381::{g1, g2_swu_iso, Fq, Fq2, Fr, FQ_ZERO};
use ark_ec::{
bls12::{self, Bls12Config},
hashing::curve_maps::wb::{IsogenyMap, WBConfig},
models::CurveConfig,
short_weierstrass::{self, *},
short_weierstrass::{self, Affine, Projective},
AffineRepr, CurveGroup, PrimeGroup,
};
use ark_ff::{AdditiveGroup, BigInt, Field, MontFp, Zero};
Expand Down
4 changes: 3 additions & 1 deletion test-curves/src/bls12_381/g2_swu_iso.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::bls12_381::*;
use crate::bls12_381::{g2, Fq, Fq2, Fr};
use ark_ec::models::{
short_weierstrass::{Affine, SWCurveConfig},
CurveConfig,
Expand Down Expand Up @@ -137,6 +137,8 @@ pub const ISOGENY_MAP_TO_G2 : IsogenyMap<'_, SwuIsoConfig, g2::Config> = Isogen

#[cfg(test)]
mod test {
use crate::bls12_381::g2_swu_iso;

use super::*;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion test-curves/src/bls12_381/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod tests;
pub use pairing::*;
#[cfg(feature = "bls12_381_curve")]
mod pairing {
use super::*;
use super::{g1, g2, Fq, Fq12Config, Fq2Config, Fq6Config};
use ark_ec::bls12::{Bls12, Bls12Config, TwistType};

pub type Bls12_381 = Bls12<Config>;
Expand Down
2 changes: 1 addition & 1 deletion test-curves/src/bn384_small_two_adicity/g1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_ec::{
models::CurveConfig,
short_weierstrass::{self, *},
short_weierstrass::{self, Affine, Projective},
};
use ark_ff::Zero;

Expand Down
2 changes: 1 addition & 1 deletion test-curves/src/mnt4_753/g1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_ec::{
models::CurveConfig,
short_weierstrass::{self, *},
short_weierstrass::{self, Affine, Projective},
};
use ark_ff::MontFp;

Expand Down
5 changes: 4 additions & 1 deletion test-curves/src/secp256k1/g1.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use crate::secp256k1::{Fq, Fr};
use ark_ec::{models::CurveConfig, short_weierstrass::*};
use ark_ec::{
models::CurveConfig,
short_weierstrass::{Affine, Projective, SWCurveConfig},
};
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};

pub type G1Affine = Affine<Config>;
Expand Down

0 comments on commit 68d0828

Please sign in to comment.