From c9cacc74672e3406013f8f1f8c04ed865ab36f9e Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 4 Mar 2018 19:51:03 -0700 Subject: [PATCH] Bump version and integrate pairing 0.14. --- Cargo.toml | 4 ++-- src/groth16/tests/dummy_engine.rs | 16 ++++++---------- src/multiexp.rs | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 676ac26d6..a0fb442de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://github.com/ebfull/bellman" license = "MIT/Apache-2.0" name = "bellman" repository = "https://github.com/ebfull/bellman" -version = "0.0.8" +version = "0.0.9" [dependencies] rand = "0.3" @@ -15,7 +15,7 @@ futures = "0.1" futures-cpupool = "0.1" num_cpus = "1" crossbeam = "0.3" -pairing = "0.13" +pairing = "0.14" byteorder = "1" [features] diff --git a/src/groth16/tests/dummy_engine.rs b/src/groth16/tests/dummy_engine.rs index 016aa90cf..26c899650 100644 --- a/src/groth16/tests/dummy_engine.rs +++ b/src/groth16/tests/dummy_engine.rs @@ -196,15 +196,11 @@ impl Default for FrRepr { } impl PrimeFieldRepr for FrRepr { - fn sub_noborrow(&mut self, other: &Self) -> bool { + fn sub_noborrow(&mut self, other: &Self) { self.0[0] = self.0[0].wrapping_sub(other.0[0]); - - false } - fn add_nocarry(&mut self, other: &Self) -> bool { + fn add_nocarry(&mut self, other: &Self) { self.0[0] = self.0[0].wrapping_add(other.0[0]); - - false } fn num_bits(&self) -> u32 { 64 - self.0[0].leading_zeros() @@ -219,15 +215,15 @@ impl PrimeFieldRepr for FrRepr { self.0[0] % 2 == 0 } fn div2(&mut self) { - self.divn(1) + self.shr(1) } - fn divn(&mut self, amt: u32) { + fn shr(&mut self, amt: u32) { self.0[0] >>= amt; } fn mul2(&mut self) { - self.muln(1) + self.shl(1) } - fn muln(&mut self, amt: u32) { + fn shl(&mut self, amt: u32) { self.0[0] <<= amt; } } diff --git a/src/multiexp.rs b/src/multiexp.rs index c23decc67..b1dc1f1fc 100644 --- a/src/multiexp.rs +++ b/src/multiexp.rs @@ -183,7 +183,7 @@ fn multiexp_inner( } } else { let mut exp = exp; - exp.divn(skip); + exp.shr(skip); let exp = exp.as_ref()[0] % (1 << c); if exp != 0 {