From 37bdc022d6ae906eb583746fea8784edc6bd7c6b Mon Sep 17 00:00:00 2001 From: Kobi Gurkan Date: Mon, 2 Sep 2019 15:50:18 +0300 Subject: [PATCH] makes phase2 compile --- bellman/src/lib.rs | 6 +++--- phase2/Cargo.toml | 3 +-- phase2/src/lib.rs | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/bellman/src/lib.rs b/bellman/src/lib.rs index 8256168..d3ce4c1 100644 --- a/bellman/src/lib.rs +++ b/bellman/src/lib.rs @@ -31,12 +31,12 @@ cfg_if! { #[cfg(feature = "wasm")] compile_error!("Multicore feature is not yet compatible with wasm target arch"); - mod multicore; + pub mod multicore; mod worker { pub use crate::multicore::*; } } else { - mod singlecore; + pub mod singlecore; mod worker { pub use crate::singlecore::*; } @@ -51,4 +51,4 @@ use std::env; fn verbose_flag() -> bool { option_env!("BELLMAN_VERBOSE").unwrap_or("0") == "1" -} \ No newline at end of file +} diff --git a/phase2/Cargo.toml b/phase2/Cargo.toml index 034af7a..36c3732 100644 --- a/phase2/Cargo.toml +++ b/phase2/Cargo.toml @@ -9,9 +9,8 @@ license = "MIT/Apache-2.0" repository = "https://github.com/ebfull/phase2" [dependencies] -pairing = "0.14" rand = "0.4" -bellman = "0.1" +bellman_ce = { path = "../bellman" } byteorder = "1" num_cpus = "1" crossbeam = "0.3" diff --git a/phase2/src/lib.rs b/phase2/src/lib.rs index e091603..311f5c9 100644 --- a/phase2/src/lib.rs +++ b/phase2/src/lib.rs @@ -195,8 +195,7 @@ //! `params.params()`, so that you can interact with the bellman APIs //! just as before. -extern crate pairing; -extern crate bellman; +extern crate bellman_ce; extern crate rand; extern crate byteorder; extern crate blake2_rfc; @@ -226,10 +225,12 @@ use std::{ } }; -use pairing::{ +use bellman_ce::pairing::{ Engine, - PrimeField, - Field, + ff::{ + PrimeField, + Field, + }, EncodedPoint, CurveAffine, CurveProjective, @@ -246,7 +247,9 @@ use pairing::{ } }; -use bellman::{ +pub use bellman_ce::multicore::*; + +use bellman_ce::{ Circuit, SynthesisError, Variable, @@ -257,7 +260,6 @@ use bellman::{ Parameters, VerifyingKey }, - multicore::Worker }; use rand::{ @@ -565,7 +567,7 @@ impl MPCParameters { let alpha_coeffs_g1 = alpha_coeffs_g1.clone(); let beta_coeffs_g1 = beta_coeffs_g1.clone(); - scope.spawn(move || { + scope.spawn(move |_| { for ((((((a_g1, b_g1), b_g2), ext), at), bt), ct) in a_g1.iter_mut() .zip(b_g1.iter_mut()) @@ -1200,7 +1202,7 @@ fn same_ratio( /// ... with high probability. fn merge_pairs(v1: &[G], v2: &[G]) -> (G, G) { - use std::sync::{Arc, Mutex}; + use std::sync::Mutex; use rand::{thread_rng}; assert_eq!(v1.len(), v2.len());