Fix some warnings and TODO's.
This commit is contained in:
parent
d616362884
commit
b15f5f6f43
12
src/lib.rs
12
src/lib.rs
|
@ -57,7 +57,7 @@ impl<E: Engine> LinearCombination<E> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn eval(
|
pub fn eval(
|
||||||
self,
|
&self,
|
||||||
mut input_density: Option<&mut DensityTracker>,
|
mut input_density: Option<&mut DensityTracker>,
|
||||||
mut aux_density: Option<&mut DensityTracker>,
|
mut aux_density: Option<&mut DensityTracker>,
|
||||||
input_assignment: &[E::Fr],
|
input_assignment: &[E::Fr],
|
||||||
|
@ -66,7 +66,7 @@ impl<E: Engine> LinearCombination<E> {
|
||||||
{
|
{
|
||||||
let mut acc = E::Fr::zero();
|
let mut acc = E::Fr::zero();
|
||||||
|
|
||||||
for (index, coeff) in self.0.into_iter() {
|
for &(index, coeff) in self.0.iter() {
|
||||||
let mut tmp;
|
let mut tmp;
|
||||||
|
|
||||||
match index {
|
match index {
|
||||||
|
@ -262,11 +262,9 @@ impl<E: Engine> TestConstraintSystem<E> {
|
||||||
pub fn is_satisfied(&self) -> bool
|
pub fn is_satisfied(&self) -> bool
|
||||||
{
|
{
|
||||||
for &(ref a, ref b, ref c) in &self.constraints {
|
for &(ref a, ref b, ref c) in &self.constraints {
|
||||||
// TODO: make eval not take self by value
|
let mut a = a.eval(None, None, &self.inputs, &self.aux);
|
||||||
|
let b = b.eval(None, None, &self.inputs, &self.aux);
|
||||||
let mut a = a.clone().eval(None, None, &self.inputs, &self.aux);
|
let c = c.eval(None, None, &self.inputs, &self.aux);
|
||||||
let b = b.clone().eval(None, None, &self.inputs, &self.aux);
|
|
||||||
let c = c.clone().eval(None, None, &self.inputs, &self.aux);
|
|
||||||
|
|
||||||
a.mul_assign(&b);
|
a.mul_assign(&b);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
||||||
use std::io;
|
use std::io;
|
||||||
use bit_vec::{self, BitVec};
|
use bit_vec::{self, BitVec};
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use futures::{BoxFuture, Future};
|
use futures::{Future};
|
||||||
use futures_cpupool::CpuPool;
|
use futures_cpupool::CpuPool;
|
||||||
|
|
||||||
use super::Error;
|
use super::Error;
|
||||||
|
@ -138,7 +138,7 @@ fn multiexp_inner<Q, D, G, S>(
|
||||||
mut skip: u32,
|
mut skip: u32,
|
||||||
c: u32,
|
c: u32,
|
||||||
handle_trivial: bool
|
handle_trivial: bool
|
||||||
) -> BoxFuture<<G as CurveAffine>::Projective, Error>
|
) -> Box<Future<Item=<G as CurveAffine>::Projective, Error=Error>>
|
||||||
where for<'a> &'a Q: QueryDensity,
|
where for<'a> &'a Q: QueryDensity,
|
||||||
D: Send + Sync + 'static + Clone + AsRef<Q>,
|
D: Send + Sync + 'static + Clone + AsRef<Q>,
|
||||||
G: CurveAffine,
|
G: CurveAffine,
|
||||||
|
@ -206,10 +206,11 @@ fn multiexp_inner<Q, D, G, S>(
|
||||||
|
|
||||||
if skip >= <G::Engine as Engine>::Fr::NUM_BITS {
|
if skip >= <G::Engine as Engine>::Fr::NUM_BITS {
|
||||||
// There isn't another region.
|
// There isn't another region.
|
||||||
this.boxed()
|
Box::new(this)
|
||||||
} else {
|
} else {
|
||||||
// There's another region more significant. Calculate and join it with
|
// There's another region more significant. Calculate and join it with
|
||||||
// this region recursively.
|
// this region recursively.
|
||||||
|
Box::new(
|
||||||
this.join(multiexp_inner(pool, bases, density_map, exponents, skip, c, false))
|
this.join(multiexp_inner(pool, bases, density_map, exponents, skip, c, false))
|
||||||
.map(move |(this, mut higher)| {
|
.map(move |(this, mut higher)| {
|
||||||
for _ in 0..c {
|
for _ in 0..c {
|
||||||
|
@ -220,7 +221,7 @@ fn multiexp_inner<Q, D, G, S>(
|
||||||
|
|
||||||
higher
|
higher
|
||||||
})
|
})
|
||||||
.boxed()
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +234,7 @@ pub fn multiexp<Q, D, G, S>(
|
||||||
exponents: Arc<Vec<<<G::Engine as Engine>::Fr as PrimeField>::Repr>>,
|
exponents: Arc<Vec<<<G::Engine as Engine>::Fr as PrimeField>::Repr>>,
|
||||||
// TODO
|
// TODO
|
||||||
// c: u32
|
// c: u32
|
||||||
) -> BoxFuture<<G as CurveAffine>::Projective, Error>
|
) -> Box<Future<Item=<G as CurveAffine>::Projective, Error=Error>>
|
||||||
where for<'a> &'a Q: QueryDensity,
|
where for<'a> &'a Q: QueryDensity,
|
||||||
D: Send + Sync + 'static + Clone + AsRef<Q>,
|
D: Send + Sync + 'static + Clone + AsRef<Q>,
|
||||||
G: CurveAffine,
|
G: CurveAffine,
|
||||||
|
|
Loading…
Reference in New Issue