Browse Source

Make pairing and groth16 optional 🎉

hush
Jack Grigg 6 years ago
parent
commit
4272cfa5b0
No known key found for this signature in database GPG Key ID: 1B8D649257DB0829
  1. 9
      Cargo.toml
  2. 3
      src/domain.rs
  3. 2
      src/lib.rs
  4. 1
      src/multiexp.rs

9
Cargo.toml

@ -22,6 +22,13 @@ byteorder = "1"
[dependencies.pairing]
git = "https://github.com/str4d/pairing"
rev = "3d41ee5abaa4888ff3607689aba007be8856816d"
optional = true
[features]
default = []
groth16 = ["pairing"]
default = ["groth16"]
[[test]]
name = "mimc"
path = "tests/mimc.rs"
required-features = ["groth16"]

3
src/domain.rs

@ -371,6 +371,7 @@ fn parallel_fft<E: ScalarEngine, T: Group<E>>(
// Test multiplying various (low degree) polynomials together and
// comparing with naive evaluations.
#[cfg(feature = "pairing")]
#[test]
fn polynomial_arith() {
use pairing::bls12_381::Bls12;
@ -418,6 +419,7 @@ fn polynomial_arith() {
test_mul::<Bls12, _>(rng);
}
#[cfg(feature = "pairing")]
#[test]
fn fft_composition() {
use pairing::bls12_381::Bls12;
@ -456,6 +458,7 @@ fn fft_composition() {
test_comp::<Bls12, _>(rng);
}
#[cfg(feature = "pairing")]
#[test]
fn parallel_fft_consistency() {
use pairing::bls12_381::Bls12;

2
src/lib.rs

@ -1,5 +1,6 @@
extern crate ff;
extern crate group;
#[cfg(feature = "pairing")]
extern crate pairing;
extern crate rand;
extern crate num_cpus;
@ -12,6 +13,7 @@ extern crate byteorder;
pub mod multicore;
mod multiexp;
pub mod domain;
#[cfg(feature = "groth16")]
pub mod groth16;
use ff::{Field, ScalarEngine};

1
src/multiexp.rs

@ -255,6 +255,7 @@ pub fn multiexp<Q, D, G, S>(
multiexp_inner(pool, bases, density_map, exponents, 0, c, true)
}
#[cfg(feature = "pairing")]
#[test]
fn test_with_bls12() {
fn naive_multiexp<G: CurveAffine>(

Loading…
Cancel
Save