Skip to content

Commit 9442655

Browse files
authored
rename DFT to FFT (#287)
1 parent a09050d commit 9442655

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cryptography/polynomial/src/domain.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl Domain {
141141
points
142142
}
143143

144-
/// Computes a DFT for the group elements(elliptic curve points) using the roots in the domain.
144+
/// Computes a FFT for the group elements(elliptic curve points) using the roots in the domain.
145145
///
146146
/// Note: Thinking about an FFT as multiple inner products between powers of the elements
147147
/// in the domain and the input polynomial makes this easier to visualize.
@@ -155,12 +155,12 @@ impl Domain {
155155
points
156156
}
157157

158-
/// Computes an IDFT for the group elements(elliptic curve points) using the roots in the domain.
158+
/// Computes an IFFT for the group elements(elliptic curve points) using the roots in the domain.
159159
pub fn ifft_g1(&self, points: Vec<G1Projective>) -> Vec<G1Projective> {
160160
self.ifft_g1_take_n(points, None)
161161
}
162162

163-
/// Computes an IDFT for the group elements(elliptic curve points) using the roots in the domain.
163+
/// Computes an IFFT for the group elements(elliptic curve points) using the roots in the domain.
164164
///
165165
/// `n`: indicates how many points we would like to return. Passing `None` will return be equivalent
166166
/// to compute an ifft_g1 and returning as many elements as there are in the domain.
@@ -223,7 +223,7 @@ impl Domain {
223223
}
224224
}
225225

226-
/// Computes a DFT of the field elements(scalars).
226+
/// Computes a FFT of the field elements(scalars).
227227
///
228228
/// Note: This is essentially multiple inner products.
229229
///
@@ -268,7 +268,7 @@ fn fft_scalar_inplace(twiddle_factors: &[Scalar], a: &mut [Scalar]) {
268268
}
269269
}
270270

271-
/// Computes a DFT of the group elements(points).
271+
/// Computes a FFT of the group elements(points).
272272
///
273273
/// Note: This is essentially multiple multi-scalar multiplications.
274274
fn fft_g1_inplace(twiddle_factors: &[Scalar], a: &mut [G1Projective]) {
@@ -403,15 +403,15 @@ mod tests {
403403
.map(|_| G1Projective::random(&mut rand::thread_rng()))
404404
.collect();
405405

406-
let dft_points = domain.fft_g1(points.clone());
406+
let fft_points = domain.fft_g1(points.clone());
407407
for (i, root) in domain.roots.iter().enumerate() {
408408
let powers = powers_of(root, points.len());
409409

410410
let expected = naive_msm(&points, &powers);
411-
let got = dft_points[i];
411+
let got = fft_points[i];
412412
assert_eq!(expected, got);
413413
}
414414

415-
assert_eq!(domain.ifft_g1(dft_points), points);
415+
assert_eq!(domain.ifft_g1(fft_points), points);
416416
}
417417
}

0 commit comments

Comments
 (0)