Skip to content

Commit

Permalink
Address or allow clippy::too_many_arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Sep 2, 2021
1 parent 355ebe2 commit d90db72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 36 deletions.
45 changes: 9 additions & 36 deletions src/gadgets/blake2s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ const SIGMA: [[usize; 16]; 10] = [
fn mixing_g<Scalar: PrimeField, CS: ConstraintSystem<Scalar>, M>(
mut cs: M,
v: &mut [UInt32],
a: usize,
b: usize,
c: usize,
d: usize,
(a, b, c, d): (usize, usize, usize, usize),
x: &UInt32,
y: &UInt32,
) -> Result<(), SynthesisError>
Expand Down Expand Up @@ -221,81 +218,57 @@ fn blake2s_compression<Scalar: PrimeField, CS: ConstraintSystem<Scalar>>(
mixing_g(
cs.namespace(|| "mixing invocation 1"),
&mut v,
0,
4,
8,
12,
(0, 4, 8, 12),
&m[s[0]],
&m[s[1]],
)?;
mixing_g(
cs.namespace(|| "mixing invocation 2"),
&mut v,
1,
5,
9,
13,
(1, 5, 9, 13),
&m[s[2]],
&m[s[3]],
)?;
mixing_g(
cs.namespace(|| "mixing invocation 3"),
&mut v,
2,
6,
10,
14,
(2, 6, 10, 14),
&m[s[4]],
&m[s[5]],
)?;
mixing_g(
cs.namespace(|| "mixing invocation 4"),
&mut v,
3,
7,
11,
15,
(3, 7, 11, 15),
&m[s[6]],
&m[s[7]],
)?;

mixing_g(
cs.namespace(|| "mixing invocation 5"),
&mut v,
0,
5,
10,
15,
(0, 5, 10, 15),
&m[s[8]],
&m[s[9]],
)?;
mixing_g(
cs.namespace(|| "mixing invocation 6"),
&mut v,
1,
6,
11,
12,
(1, 6, 11, 12),
&m[s[10]],
&m[s[11]],
)?;
mixing_g(
cs.namespace(|| "mixing invocation 7"),
&mut v,
2,
7,
8,
13,
(2, 7, 8, 13),
&m[s[12]],
&m[s[13]],
)?;
mixing_g(
cs.namespace(|| "mixing invocation 8"),
&mut v,
3,
4,
9,
14,
(3, 4, 9, 14),
&m[s[14]],
&m[s[15]],
)?;
Expand Down
2 changes: 2 additions & 0 deletions src/groth16/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ impl<Scalar: PrimeField> ConstraintSystem<Scalar> for KeypairAssembly<Scalar> {
}

/// Create parameters for a circuit, given some toxic waste.
#[allow(clippy::too_many_arguments)]
pub fn generate_parameters<E, C>(
circuit: C,
g1: E::G1,
Expand Down Expand Up @@ -300,6 +301,7 @@ where
let mut ic = vec![E::G1Affine::identity(); assembly.num_inputs];
let mut l = vec![E::G1Affine::identity(); assembly.num_aux];

#[allow(clippy::too_many_arguments)]
fn eval<E: Engine>(
// wNAF window tables
g1_wnaf: &Wnaf<usize, &[E::G1], &mut Vec<i64>>,
Expand Down

0 comments on commit d90db72

Please sign in to comment.