PrimeField --> ff::PrimeField (#28)

* PrimeField --> ff::PrimeField

* cargo fmt
This commit is contained in:
Srinath Setty
2022-04-14 07:48:55 -07:00
committed by GitHub
parent c20da2f58c
commit 9a44d06aec
9 changed files with 41 additions and 117 deletions

View File

@@ -5,7 +5,7 @@ use std::{
collections::{BTreeMap, HashMap},
};
use crate::traits::{Group, PrimeField as PF};
use crate::traits::Group;
use ff::{Field, PrimeField};
use bellperson::{ConstraintSystem, Index, LinearCombination, SynthesisError, Variable};
@@ -142,7 +142,7 @@ where
s.push_str(&format!("INPUT {}\n", &input))
}
let negone = -<G::Scalar as PF>::one();
let negone = -<G::Scalar>::one();
let powers_of_two = (0..G::Scalar::NUM_BITS)
.map(|i| G::Scalar::from(2u64).pow_vartime(&[u64::from(i)]))
@@ -159,7 +159,7 @@ where
}
is_first = false;
if coeff != <G::Scalar as PF>::one() && coeff != negone {
if coeff != <G::Scalar>::one() && coeff != negone {
for (i, x) in powers_of_two.iter().enumerate() {
if x == &coeff {
s.push_str(&format!("2^{} . ", i));

View File

@@ -1,7 +1,7 @@
//! Support for generating R1CS witness using bellperson.
use crate::traits::{Group, PrimeField as PF};
use ff::PrimeField;
use crate::traits::Group;
use ff::{Field, PrimeField};
use bellperson::{
multiexp::DensityTracker, ConstraintSystem, Index, LinearCombination, SynthesisError, Variable,