mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-10 16:11:29 +01:00
remove unused where (#38)
This commit is contained in:
@@ -26,7 +26,7 @@ use bellperson::{
|
||||
},
|
||||
Circuit, ConstraintSystem, SynthesisError,
|
||||
};
|
||||
use ff::{Field, PrimeField, PrimeFieldBits};
|
||||
use ff::Field;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct NIFSVerifierCircuitParams {
|
||||
@@ -44,10 +44,7 @@ impl NIFSVerifierCircuitParams {
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ where
|
||||
}
|
||||
|
||||
/// 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 @@ where
|
||||
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 @@ where
|
||||
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 @@ where
|
||||
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 @@ mod tests {
|
||||
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,
|
||||
|
||||
@@ -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 @@ where
|
||||
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 @@ where
|
||||
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 @@ where
|
||||
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>>(
|
||||
|
||||
@@ -5,7 +5,7 @@ use core::{
|
||||
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 @@ pub trait Group:
|
||||
+ 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>;
|
||||
|
||||
Reference in New Issue
Block a user