From b089e99536f52c1fe3c53410d36e9f8143b399ed Mon Sep 17 00:00:00 2001 From: arnaucube Date: Mon, 25 Nov 2024 16:41:04 +0100 Subject: [PATCH] fix clippy lints after updating to v1.82.0 --- cli/src/main.rs | 6 +++++- folding-schemes/src/folding/nova/zk.rs | 24 ++++++++++-------------- folding-schemes/src/lib.rs | 1 + frontends/src/circom/mod.rs | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 32802153..bdd51249 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -7,7 +7,11 @@ use std::{fs, io}; mod settings; fn create_or_open_then_write>(path: &Path, content: &T) -> Result<(), io::Error> { - let mut file = fs::OpenOptions::new().create(true).write(true).open(path)?; + let mut file = fs::OpenOptions::new() + .create(true) + .truncate(true) + .write(true) + .open(path)?; file.write_all(content.as_ref()) } diff --git a/folding-schemes/src/folding/nova/zk.rs b/folding-schemes/src/folding/nova/zk.rs index 206d3025..63b5836a 100644 --- a/folding-schemes/src/folding/nova/zk.rs +++ b/folding-schemes/src/folding/nova/zk.rs @@ -71,23 +71,21 @@ where /// Compute a zero-knowledge proof of a Nova IVC proof /// It implements the prover of appendix D.4.in https://eprint.iacr.org/2023/573.pdf /// For further details on why folding is hiding, see lemma 9 - pub fn new< - GC1: CurveVar> + ToConstraintFieldGadget>, - GC2: CurveVar>, - FC: FCircuit, - CS1: CommitmentScheme, - CS2: CommitmentScheme, - >( + pub fn new( nova: &Nova, mut rng: impl RngCore, ) -> Result, Error> where + GC1: CurveVar> + ToConstraintFieldGadget>, + GC2: CurveVar> + ToConstraintFieldGadget<::BaseField>, + FC: FCircuit, + CS1: CommitmentScheme, + CS2: CommitmentScheme, ::ScalarField: Absorb, ::ScalarField: Absorb, ::ScalarField: PrimeField, ::BaseField: PrimeField, ::BaseField: Absorb, - GC2: ToConstraintFieldGadget<::BaseField>, C1: CurveGroup, { let mut transcript = PoseidonSponge::::new(&nova.poseidon_config); @@ -138,11 +136,7 @@ where /// Verify a zero-knowledge proof of a Nova IVC proof /// It implements the verifier of appendix D.4. in https://eprint.iacr.org/2023/573.pdf #[allow(clippy::too_many_arguments)] - pub fn verify< - CS1: CommitmentScheme, - GC2: CurveVar>, - CS2: CommitmentScheme, - >( + pub fn verify( r1cs: &R1CS, cf_r1cs: &R1CS, pp_hash: C1::ScalarField, @@ -153,11 +147,13 @@ where proof: &RandomizedIVCProof, ) -> Result<(), Error> where + CS1: CommitmentScheme, + GC2: CurveVar>, + CS2: CommitmentScheme + ToConstraintFieldGadget<::BaseField>, ::ScalarField: Absorb, ::ScalarField: Absorb, ::BaseField: PrimeField, ::BaseField: Absorb, - GC2: ToConstraintFieldGadget<::BaseField>, C1: CurveGroup, { // Handles case where i=0 diff --git a/folding-schemes/src/lib.rs b/folding-schemes/src/lib.rs index a829fe6d..8da8b117 100644 --- a/folding-schemes/src/lib.rs +++ b/folding-schemes/src/lib.rs @@ -1,6 +1,7 @@ #![allow(non_snake_case)] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] +#![allow(clippy::doc_lazy_continuation)] use ark_ec::{pairing::Pairing, CurveGroup}; use ark_ff::PrimeField; diff --git a/frontends/src/circom/mod.rs b/frontends/src/circom/mod.rs index 88a9da5b..313a5602 100644 --- a/frontends/src/circom/mod.rs +++ b/frontends/src/circom/mod.rs @@ -8,8 +8,8 @@ use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystemRef, SynthesisE use ark_std::fmt::Debug; use folding_schemes::{frontend::FCircuit, utils::PathOrBin, Error}; use num_bigint::BigInt; +use std::fmt; use std::rc::Rc; -use std::{fmt, usize}; pub mod utils; use utils::CircomWrapper;