From ad378785337edfdf340168514645d94bf4e1d4a4 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Fri, 16 Aug 2019 22:58:05 -0600 Subject: [PATCH] cargo fix --edition for bellman --- src/gadgets/uint32.rs | 4 ++-- src/groth16/generator.rs | 6 +++--- src/groth16/mod.rs | 6 +++--- src/groth16/prover.rs | 8 ++++---- src/groth16/tests/mod.rs | 2 +- src/groth16/verifier.rs | 2 +- tests/mimc.rs | 8 ++++---- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/gadgets/uint32.rs b/src/gadgets/uint32.rs index 4c0d37601..ef3f44aea 100644 --- a/src/gadgets/uint32.rs +++ b/src/gadgets/uint32.rs @@ -401,7 +401,7 @@ mod test { ]); for _ in 0..1000 { - let mut v = (0..32) + let v = (0..32) .map(|_| Boolean::constant(rng.next_u32() % 2 != 0)) .collect::>(); @@ -436,7 +436,7 @@ mod test { ]); for _ in 0..1000 { - let mut v = (0..32) + let v = (0..32) .map(|_| Boolean::constant(rng.next_u32() % 2 != 0)) .collect::>(); diff --git a/src/groth16/generator.rs b/src/groth16/generator.rs index 596464f31..2ece8b7ec 100644 --- a/src/groth16/generator.rs +++ b/src/groth16/generator.rs @@ -8,11 +8,11 @@ use pairing::Engine; use super::{Parameters, VerifyingKey}; -use {Circuit, ConstraintSystem, Index, LinearCombination, SynthesisError, Variable}; +use crate::{Circuit, ConstraintSystem, Index, LinearCombination, SynthesisError, Variable}; -use domain::{EvaluationDomain, Scalar}; +use crate::domain::{EvaluationDomain, Scalar}; -use multicore::Worker; +use crate::multicore::Worker; /// Generates a random common reference string for /// a circuit. diff --git a/src/groth16/mod.rs b/src/groth16/mod.rs index 85b7952bf..428176bf9 100644 --- a/src/groth16/mod.rs +++ b/src/groth16/mod.rs @@ -1,10 +1,10 @@ use group::{CurveAffine, EncodedPoint}; use pairing::{Engine, PairingCurveAffine}; -use SynthesisError; +use crate::SynthesisError; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; -use multiexp::SourceBuilder; +use crate::multiexp::SourceBuilder; use std::io::{self, Read, Write}; use std::sync::Arc; @@ -465,7 +465,7 @@ impl<'a, E: Engine> ParameterSource for &'a Parameters { #[cfg(test)] mod test_with_bls12_381 { use super::*; - use {Circuit, ConstraintSystem, SynthesisError}; + use crate::{Circuit, ConstraintSystem, SynthesisError}; use ff::Field; use pairing::bls12_381::{Bls12, Fr}; diff --git a/src/groth16/prover.rs b/src/groth16/prover.rs index a502ac332..7fe282f6c 100644 --- a/src/groth16/prover.rs +++ b/src/groth16/prover.rs @@ -10,13 +10,13 @@ use pairing::Engine; use super::{ParameterSource, Proof}; -use {Circuit, ConstraintSystem, Index, LinearCombination, SynthesisError, Variable}; +use crate::{Circuit, ConstraintSystem, Index, LinearCombination, SynthesisError, Variable}; -use domain::{EvaluationDomain, Scalar}; +use crate::domain::{EvaluationDomain, Scalar}; -use multiexp::{multiexp, DensityTracker, FullDensity}; +use crate::multiexp::{multiexp, DensityTracker, FullDensity}; -use multicore::Worker; +use crate::multicore::Worker; fn eval( lc: &LinearCombination, diff --git a/src/groth16/tests/mod.rs b/src/groth16/tests/mod.rs index e6a36e4bc..d8be98e40 100644 --- a/src/groth16/tests/mod.rs +++ b/src/groth16/tests/mod.rs @@ -6,7 +6,7 @@ use self::dummy_engine::*; use std::marker::PhantomData; -use {Circuit, ConstraintSystem, SynthesisError}; +use crate::{Circuit, ConstraintSystem, SynthesisError}; use super::{create_proof, generate_parameters, prepare_verifying_key, verify_proof}; diff --git a/src/groth16/verifier.rs b/src/groth16/verifier.rs index 926955a98..065a3b0fb 100644 --- a/src/groth16/verifier.rs +++ b/src/groth16/verifier.rs @@ -4,7 +4,7 @@ use pairing::{Engine, PairingCurveAffine}; use super::{PreparedVerifyingKey, Proof, VerifyingKey}; -use SynthesisError; +use crate::SynthesisError; pub fn prepare_verifying_key(vk: &VerifyingKey) -> PreparedVerifyingKey { let mut gamma = vk.gamma_g2; diff --git a/tests/mimc.rs b/tests/mimc.rs index 18aaece94..94c0d63bb 100644 --- a/tests/mimc.rs +++ b/tests/mimc.rs @@ -90,12 +90,12 @@ impl<'a, E: Engine> Circuit for MiMCDemo<'a, E> { let cs = &mut cs.namespace(|| format!("round {}", i)); // tmp = (xL + Ci)^2 - let mut tmp_value = xl_value.map(|mut e| { + let tmp_value = xl_value.map(|mut e| { e.add_assign(&self.constants[i]); e.square(); e }); - let mut tmp = cs.alloc( + let tmp = cs.alloc( || "tmp", || tmp_value.ok_or(SynthesisError::AssignmentMissing), )?; @@ -110,14 +110,14 @@ impl<'a, E: Engine> Circuit for MiMCDemo<'a, E> { // new_xL = xR + (xL + Ci)^3 // new_xL = xR + tmp * (xL + Ci) // new_xL - xR = tmp * (xL + Ci) - let mut new_xl_value = xl_value.map(|mut e| { + let new_xl_value = xl_value.map(|mut e| { e.add_assign(&self.constants[i]); e.mul_assign(&tmp_value.unwrap()); e.add_assign(&xr_value.unwrap()); e }); - let mut new_xl = if i == (MIMC_ROUNDS - 1) { + let new_xl = if i == (MIMC_ROUNDS - 1) { // This is the last round, xL is our image and so // we allocate a public input. cs.alloc_input(