diff --git a/benches/hashing.rs b/benches/hashing.rs index 5669e50b..c229972e 100644 --- a/benches/hashing.rs +++ b/benches/hashing.rs @@ -19,7 +19,7 @@ pub(crate) fn bench_gmimc, const WIDTH: usize>(c: &mut Criterion pub(crate) fn bench_poseidon, const WIDTH: usize>(c: &mut Criterion) where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { c.bench_function(&format!("poseidon<{}, {}>", type_name::(), WIDTH), |b| { b.iter_batched( diff --git a/src/field/packed_avx2/mod.rs b/src/field/packed_avx2/mod.rs index eddbb5c9..20eecba7 100644 --- a/src/field/packed_avx2/mod.rs +++ b/src/field/packed_avx2/mod.rs @@ -34,7 +34,7 @@ mod tests { fn test_add() where - [(); PackedPrimeField::::WIDTH]: , + [(); PackedPrimeField::::WIDTH]:, { let a_arr = test_vals_a::(); let b_arr = test_vals_b::(); @@ -52,7 +52,7 @@ mod tests { fn test_mul() where - [(); PackedPrimeField::::WIDTH]: , + [(); PackedPrimeField::::WIDTH]:, { let a_arr = test_vals_a::(); let b_arr = test_vals_b::(); @@ -70,7 +70,7 @@ mod tests { fn test_square() where - [(); PackedPrimeField::::WIDTH]: , + [(); PackedPrimeField::::WIDTH]:, { let a_arr = test_vals_a::(); @@ -86,7 +86,7 @@ mod tests { fn test_neg() where - [(); PackedPrimeField::::WIDTH]: , + [(); PackedPrimeField::::WIDTH]:, { let a_arr = test_vals_a::(); @@ -102,7 +102,7 @@ mod tests { fn test_sub() where - [(); PackedPrimeField::::WIDTH]: , + [(); PackedPrimeField::::WIDTH]:, { let a_arr = test_vals_a::(); let b_arr = test_vals_b::(); @@ -120,7 +120,7 @@ mod tests { fn test_interleave_is_involution() where - [(); PackedPrimeField::::WIDTH]: , + [(); PackedPrimeField::::WIDTH]:, { let a_arr = test_vals_a::(); let b_arr = test_vals_b::(); @@ -144,7 +144,7 @@ mod tests { fn test_interleave() where - [(); PackedPrimeField::::WIDTH]: , + [(); PackedPrimeField::::WIDTH]:, { let in_a: [F; 4] = [ F::from_noncanonical_u64(00), diff --git a/src/gadgets/hash.rs b/src/gadgets/hash.rs index 99da9e1e..db4cb1e8 100644 --- a/src/gadgets/hash.rs +++ b/src/gadgets/hash.rs @@ -15,7 +15,7 @@ impl, const D: usize> CircuitBuilder { pub fn permute(&mut self, inputs: [Target; W]) -> [Target; W] where F: GMiMC + Poseidon, - [(); W - 1]: , + [(); W - 1]:, { // We don't want to swap any inputs, so set that wire to 0. let _false = self._false(); @@ -31,7 +31,7 @@ impl, const D: usize> CircuitBuilder { ) -> [Target; W] where F: GMiMC + Poseidon, - [(); W - 1]: , + [(); W - 1]:, { match HASH_FAMILY { HashFamily::GMiMC => self.gmimc_permute_swapped(inputs, swap), @@ -88,7 +88,7 @@ impl, const D: usize> CircuitBuilder { ) -> [Target; W] where F: Poseidon, - [(); W - 1]: , + [(); W - 1]:, { let gate_type = PoseidonGate::::new(); let gate = self.add_gate(gate_type, vec![]); diff --git a/src/gates/poseidon.rs b/src/gates/poseidon.rs index 1f5f746d..6e1eb69a 100644 --- a/src/gates/poseidon.rs +++ b/src/gates/poseidon.rs @@ -26,7 +26,7 @@ pub struct PoseidonGate< const D: usize, const WIDTH: usize, > where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { _phantom: PhantomData, } @@ -34,7 +34,7 @@ pub struct PoseidonGate< impl + Poseidon, const D: usize, const WIDTH: usize> PoseidonGate where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { pub fn new() -> Self { PoseidonGate { @@ -91,7 +91,7 @@ where impl + Poseidon, const D: usize, const WIDTH: usize> Gate for PoseidonGate where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { fn id(&self) -> String { format!("{:?}", self, WIDTH) @@ -396,7 +396,7 @@ struct PoseidonGenerator< const D: usize, const WIDTH: usize, > where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { gate_index: usize, _phantom: PhantomData, @@ -405,7 +405,7 @@ struct PoseidonGenerator< impl + Poseidon, const D: usize, const WIDTH: usize> SimpleGenerator for PoseidonGenerator where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { fn dependencies(&self) -> Vec { (0..WIDTH) diff --git a/src/gates/poseidon_mds.rs b/src/gates/poseidon_mds.rs index 8a42b588..a127df68 100644 --- a/src/gates/poseidon_mds.rs +++ b/src/gates/poseidon_mds.rs @@ -21,7 +21,7 @@ pub struct PoseidonMdsGate< const D: usize, const WIDTH: usize, > where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { _phantom: PhantomData, } @@ -29,7 +29,7 @@ pub struct PoseidonMdsGate< impl + Poseidon, const D: usize, const WIDTH: usize> PoseidonMdsGate where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { pub fn new() -> Self { PoseidonMdsGate { @@ -116,7 +116,7 @@ where impl + Poseidon, const D: usize, const WIDTH: usize> Gate for PoseidonMdsGate where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { fn id(&self) -> String { format!("{:?}", self, WIDTH) @@ -207,7 +207,7 @@ where #[derive(Clone, Debug)] struct PoseidonMdsGenerator where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { gate_index: usize, } @@ -215,7 +215,7 @@ where impl + Poseidon, const D: usize, const WIDTH: usize> SimpleGenerator for PoseidonMdsGenerator where - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { fn dependencies(&self) -> Vec { (0..WIDTH) diff --git a/src/hash/poseidon.rs b/src/hash/poseidon.rs index 9a52060c..9e4dd7f4 100644 --- a/src/hash/poseidon.rs +++ b/src/hash/poseidon.rs @@ -147,7 +147,7 @@ pub const ALL_ROUND_CONSTANTS: [u64; MAX_WIDTH * N_ROUNDS] = [ pub trait Poseidon: PrimeField where // magic to get const generic expressions to work - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { // Total number of round constants required: width of the input // times number of rounds. @@ -634,7 +634,7 @@ pub(crate) mod test_helpers { test_vectors: Vec<([u64; WIDTH], [u64; WIDTH])>, ) where F: Poseidon, - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { for (input_, expected_output_) in test_vectors.into_iter() { let mut input = [F::ZERO; WIDTH]; @@ -652,7 +652,7 @@ pub(crate) mod test_helpers { pub(crate) fn check_consistency() where F: Poseidon, - [(); WIDTH - 1]: , + [(); WIDTH - 1]:, { let mut input = [F::ZERO; WIDTH]; for i in 0..WIDTH {