ff: PrimeField::{is_even, is_odd}

This commit is contained in:
Jack Grigg
2020-04-21 19:05:19 +12:00
parent 232f0a50b8
commit 1fdca393bb
10 changed files with 54 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
//! The Sapling circuits.
use ff::{Field, PrimeField, PrimeFieldRepr};
use ff::{Field, PrimeField};
use bellman::{Circuit, ConstraintSystem, SynthesisError};
@@ -478,7 +478,7 @@ impl<'a, E: JubjubEngine> Circuit<E> for Output<'a, E> {
// Witness the sign bit
let sign_bit = boolean::Boolean::from(boolean::AllocatedBit::alloc(
cs.namespace(|| "pk_d bit of x"),
pk_d.map(|e| e.0.into_repr().is_odd()),
pk_d.map(|e| e.0.is_odd()),
)?);
// Extend the note with pk_d representation