Skip to content

Commit

Permalink
chore: fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenciak committed Mar 7, 2024
1 parent f912350 commit 0232b8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/cyclefold/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ impl<E: Engine> CyclefoldCircuit<E> {

let C_final = C_1.add(cs.namespace(|| "C_1 + r * C_2"), &r_C_2)?;

self.inputize_point(C_1, cs.namespace(|| "inputize C_1"))?;
self.inputize_point(C_2, cs.namespace(|| "inputize C_2"))?;
self.inputize_point(C_final, cs.namespace(|| "inputize C_final"))?;
self.inputize_point(&C_1, cs.namespace(|| "inputize C_1"))?;
self.inputize_point(&C_2, cs.namespace(|| "inputize C_2"))?;
self.inputize_point(&C_final, cs.namespace(|| "inputize C_final"))?;

let scalar = le_bits_to_num(cs.namespace(|| "get scalar"), &r)?;

Expand All @@ -112,7 +112,7 @@ impl<E: Engine> CyclefoldCircuit<E> {
// Represent the point in the public IO as its 2-ary Poseidon hash
fn inputize_point<CS>(
&self,
point: AllocatedPoint<E::GE>,
point: &AllocatedPoint<E::GE>,
mut cs: CS,
) -> Result<(), SynthesisError>
where
Expand All @@ -131,13 +131,7 @@ impl<E: Engine> CyclefoldCircuit<E> {

let is_infinity_bit = AllocatedBit::alloc(
cs.namespace(|| "is_infinity"),
Some(
if is_infinity.get_value().unwrap_or(E::Base::ONE) == E::Base::ONE {
true
} else {
false
},
),
Some(is_infinity.get_value().unwrap_or(E::Base::ONE) == E::Base::ONE),
)?;

cs.enforce(
Expand Down Expand Up @@ -267,7 +261,7 @@ mod tests {
return E::Scalar::ZERO;
}

let mut hasher = Poseidon::new_with_preimage(&vec![x, y], &circuit.poseidon_constants);
let mut hasher = Poseidon::new_with_preimage(&[x, y], &circuit.poseidon_constants);

hasher.hash()
};
Expand Down
1 change: 1 addition & 0 deletions src/cyclefold/nifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ where
/// The difference of this folding scheme from the Nova NIFS in `src/nifs.rs` is that this folding
/// prover and verifier must fold in the `RelaxedR1CSInstance` accumulator because the optimization
/// in the
#[derive(Debug)]
pub struct CycleFoldNIFS<E: Engine> {
pub(crate) comm_T: CompressedCommitment<E>,
}
Expand Down

0 comments on commit 0232b8d

Please sign in to comment.