diff --git a/math/benches/utils/fft_functions.rs b/math/benches/utils/fft_functions.rs index 57b467e42..2bb587599 100644 --- a/math/benches/utils/fft_functions.rs +++ b/math/benches/utils/fft_functions.rs @@ -3,7 +3,7 @@ use criterion::black_box; use lambdaworks_math::fft::cpu::{ bit_reversing::in_place_bit_reverse_permute, - fft::{in_place_nr_2radix_fft, in_place_rn_2radix_fft, in_place_nr_4radix_fft}, + fft::{in_place_nr_2radix_fft, in_place_nr_4radix_fft, in_place_rn_2radix_fft}, roots_of_unity::get_twiddles, }; use lambdaworks_math::{field::traits::RootsConfig, polynomial::Polynomial}; diff --git a/math/src/fft/cpu/fft.rs b/math/src/fft/cpu/fft.rs index 7c3836ce8..8539dc2c3 100644 --- a/math/src/fft/cpu/fft.rs +++ b/math/src/fft/cpu/fft.rs @@ -123,7 +123,7 @@ where { debug_assert!(input.len().is_power_of_two()); //debug_assert!(input.len().ilog2() % 2 == 0); // let k = log2(x), k.is_even() => 2^k == 2^2*k' - // with k' = k / 2 => x is power of 4 + // with k' = k / 2 => x is power of 4 // divide input in groups, starting with 1, duplicating the number of groups in each stage. let mut group_count = 1; let mut group_size = input.len(); @@ -139,10 +139,18 @@ where let first_in_group = group * group_size; let first_in_next_group = first_in_group + group_size / 4; - let (w1, w2, w3) = (&twiddles[group], &twiddles[2 * group], &twiddles[2 * group + 1]); + let (w1, w2, w3) = ( + &twiddles[group], + &twiddles[2 * group], + &twiddles[2 * group + 1], + ); for i in first_in_group..first_in_next_group { - let (j, k, l) = (i + group_size / 4, i + group_size / 2, i + 3 * group_size / 4); + let (j, k, l) = ( + i + group_size / 4, + i + group_size / 2, + i + 3 * group_size / 4, + ); let zw1 = w1 * &input[k]; let tw1 = w1 * &input[l];