arnaucube
arnaucube/NovaPublic Self-hosted repository
remove unused where (#38)

Srinath Setty srinath@microsoft.com
Mon, 25 Apr 2022 15:58:30 -0700
commit

fd0b0b787bf7b5183f7f61242ec522783aa935a2

parent

fbc855d1d67dd461d92c727b8f304ac9a1886b16

3 files changed, 11 insertions(+), 30 deletions(-)

jump to
M src/circuit.rs → src/circuit.rs

@@ -26,7 +26,7 @@ Assignment,

}, Circuit, ConstraintSystem, SynthesisError, }; -use ff::{Field, PrimeField, PrimeFieldBits}; +use ff::Field; #[derive(Debug, Clone)] pub struct NIFSVerifierCircuitParams {

@@ -44,10 +44,7 @@ }

} } -pub struct NIFSVerifierCircuitInputs<G> -where - G: Group, -{ +pub struct NIFSVerifierCircuitInputs<G: Group> { params: G::Base, // Hash(Shape of u2, Gens for u2). Needed for computing the challenge. i: G::Base, z0: G::Base,

@@ -85,10 +82,9 @@ }

} /// Circuit that encodes only the folding verifier -pub struct NIFSVerifierCircuit<G, SC> +pub struct NIFSVerifierCircuit<G: Group, SC> where G: Group, - <G as Group>::Base: ff::PrimeField, SC: StepCircuit<G::Base>, { params: NIFSVerifierCircuitParams,

@@ -100,8 +96,6 @@

impl<G, SC> NIFSVerifierCircuit<G, SC> where G: Group, - <G as Group>::Base: PrimeField + PrimeFieldBits, - <G as Group>::Scalar: PrimeField + PrimeFieldBits, SC: StepCircuit<G::Base>, { /// Create a new verification circuit for the input relaxed r1cs instances

@@ -111,10 +105,7 @@ params: NIFSVerifierCircuitParams,

inputs: Option<NIFSVerifierCircuitInputs<G>>, step_circuit: SC, poseidon_constants: NovaPoseidonConstants<G::Base>, - ) -> Self - where - <G as Group>::Base: ff::PrimeField, - { + ) -> Self { Self { params, inputs,

@@ -243,8 +234,6 @@

impl<G, SC> Circuit<<G as Group>::Base> for NIFSVerifierCircuit<G, SC> where G: Group, - <G as Group>::Base: PrimeField + PrimeFieldBits, - <G as Group>::Scalar: PrimeFieldBits, SC: StepCircuit<G::Base>, { fn synthesize<CS: ConstraintSystem<<G as Group>::Base>>(

@@ -347,18 +336,16 @@ use crate::{

bellperson::r1cs::{NovaShape, NovaWitness}, commitments::CommitTrait, }; + use ff::PrimeField; use std::marker::PhantomData; - struct TestCircuit<F> - where - F: PrimeField + ff::PrimeField, - { + struct TestCircuit<F: PrimeField> { _p: PhantomData<F>, } impl<F> StepCircuit<F> for TestCircuit<F> where - F: PrimeField + ff::PrimeField, + F: PrimeField, { fn synthesize<CS: ConstraintSystem<F>>( &self,
M src/gadgets/r1cs.rs → src/gadgets/r1cs.rs

@@ -18,7 +18,7 @@ use bellperson_nonnative::{

mp::bignat::BigNat, util::{convert::f_to_nat, num::Num}, }; -use ff::{Field, PrimeField, PrimeFieldBits}; +use ff::Field; /// An Allocated R1CS Instance #[derive(Clone)]

@@ -34,8 +34,6 @@

impl<G> AllocatedR1CSInstance<G> where G: Group, - <G as Group>::Base: PrimeField + PrimeFieldBits, - <G as Group>::Scalar: PrimeFieldBits, { /// Takes the r1cs instance and creates a new allocated r1cs instance pub fn alloc<CS: ConstraintSystem<<G as Group>::Base>>(

@@ -74,8 +72,6 @@ /// An Allocated Relaxed R1CS Instance

pub struct AllocatedRelaxedR1CSInstance<G> where G: Group, - <G as Group>::Base: PrimeField + PrimeFieldBits, - <G as Group>::Scalar: PrimeFieldBits, { pub(crate) W: AllocatedPoint<G::Base>, pub(crate) E: AllocatedPoint<G::Base>,

@@ -87,8 +83,6 @@

impl<G> AllocatedRelaxedR1CSInstance<G> where G: Group, - <G as Group>::Base: PrimeField + PrimeFieldBits, - <G as Group>::Scalar: PrimeFieldBits, { /// Allocates the given RelaxedR1CSInstance as a witness of the circuit pub fn alloc<CS: ConstraintSystem<<G as Group>::Base>>(
M src/traits.rs → src/traits.rs

@@ -5,7 +5,7 @@ borrow::Borrow,

fmt::Debug, ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign}, }; -use ff::PrimeField; +use ff::{PrimeField, PrimeFieldBits}; use merlin::Transcript; use rug::Integer;

@@ -22,10 +22,10 @@ + ScalarMul<<Self as Group>::Scalar>

+ ScalarMulOwned<<Self as Group>::Scalar> { /// A type representing an element of the base field of the group - type Base: PrimeField; + type Base: PrimeField + PrimeFieldBits; /// A type representing an element of the scalar field of the group - type Scalar: PrimeField + ChallengeTrait; + type Scalar: PrimeField + PrimeFieldBits + ChallengeTrait; /// A type representing the compressed version of the group element type CompressedGroupElement: CompressedGroup<GroupElement = Self>;