Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ff crate for traits and impls #90

Merged
merged 11 commits into from
Jul 5, 2018
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name = "pairing"

# Remember to change version string in README.md.
version = "0.14.2"
authors = ["Sean Bowe <[email protected]>"]
authors = [
"Sean Bowe <[email protected]>",
"Jack Grigg <[email protected]>",
]
license = "MIT/Apache-2.0"

description = "Pairing-friendly elliptic curve library"
Expand All @@ -15,9 +18,10 @@ repository = "https://github.com/ebfull/pairing"
rand = "0.4"
byteorder = "1"
clippy = { version = "0.0.200", optional = true }
ff = "0.3"

[features]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change u128-support feature in here to u128-support = ["ff/u128-support"] until we've removed u128-support from ff.

unstable-features = ["expose-arith"]
expose-arith = []
u128-support = []
u128-support = ["ff/u128-support"]
default = []
2 changes: 1 addition & 1 deletion benches/bls12_381/fq.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rand::{Rand, SeedableRng, XorShiftRng};

use ff::{Field, PrimeField, PrimeFieldRepr, SqrtField};
use pairing::bls12_381::*;
use pairing::{Field, PrimeField, PrimeFieldRepr, SqrtField};

#[bench]
fn bench_fq_repr_add_nocarry(b: &mut ::test::Bencher) {
Expand Down
2 changes: 1 addition & 1 deletion benches/bls12_381/fq12.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rand::{Rand, SeedableRng, XorShiftRng};

use ff::Field;
use pairing::bls12_381::*;
use pairing::Field;

#[bench]
fn bench_fq12_add_assign(b: &mut ::test::Bencher) {
Expand Down
2 changes: 1 addition & 1 deletion benches/bls12_381/fq2.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rand::{Rand, SeedableRng, XorShiftRng};

use ff::{Field, SqrtField};
use pairing::bls12_381::*;
use pairing::{Field, SqrtField};

#[bench]
fn bench_fq2_add_assign(b: &mut ::test::Bencher) {
Expand Down
2 changes: 1 addition & 1 deletion benches/bls12_381/fr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rand::{Rand, SeedableRng, XorShiftRng};

use ff::{Field, PrimeField, PrimeFieldRepr};
use pairing::bls12_381::*;
use pairing::{Field, PrimeField, PrimeFieldRepr, SqrtField};

#[bench]
fn bench_fr_repr_add_nocarry(b: &mut ::test::Bencher) {
Expand Down
1 change: 1 addition & 0 deletions benches/pairing_benches.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![feature(test)]

extern crate ff;
extern crate pairing;
extern crate rand;
extern crate test;
Expand Down
12 changes: 4 additions & 8 deletions src/bls12_381/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,12 +623,10 @@ macro_rules! curve_impl {
pub mod g1 {
use super::super::{Bls12, Fq, Fq12, FqRepr, Fr, FrRepr};
use super::g2::G2Affine;
use ff::{BitIterator, Field, PrimeField, PrimeFieldRepr, SqrtField};
use rand::{Rand, Rng};
use std::fmt;
use {
BitIterator, CurveAffine, CurveProjective, EncodedPoint, Engine, Field, GroupDecodingError,
PrimeField, PrimeFieldRepr, SqrtField,
};
use {CurveAffine, CurveProjective, EncodedPoint, Engine, GroupDecodingError};

curve_impl!(
"G1",
Expand Down Expand Up @@ -1270,12 +1268,10 @@ pub mod g1 {
pub mod g2 {
use super::super::{Bls12, Fq, Fq12, Fq2, FqRepr, Fr, FrRepr};
use super::g1::G1Affine;
use ff::{BitIterator, Field, PrimeField, PrimeFieldRepr, SqrtField};
use rand::{Rand, Rng};
use std::fmt;
use {
BitIterator, CurveAffine, CurveProjective, EncodedPoint, Engine, Field, GroupDecodingError,
PrimeField, PrimeFieldRepr, SqrtField,
};
use {CurveAffine, CurveProjective, EncodedPoint, Engine, GroupDecodingError};

curve_impl!(
"G2",
Expand Down
Loading