From 8986f1cde3189e71dde405dafe7509d2d004d34a Mon Sep 17 00:00:00 2001 From: Ben Edgington Date: Wed, 10 Feb 2021 11:15:35 +0000 Subject: [PATCH] Fix strided FFT --- src/fft_fr.c | 2 +- src/fft_g1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fft_fr.c b/src/fft_fr.c index ea9d561..c3efb5d 100644 --- a/src/fft_fr.c +++ b/src/fft_fr.c @@ -61,7 +61,7 @@ C_KZG_RET fft_fr(blst_fr *out, const blst_fr *in, const FFTSettings *fs, bool in fr_from_uint64(&inv_len, n); blst_fr_eucl_inverse(&inv_len, &inv_len); fft_fr_fast(out, in, 1, fs->reverse_roots_of_unity, stride, n); - for (uint64_t i = 0; i < fs->max_width; i++) { + for (uint64_t i = 0; i < n; i++) { blst_fr_mul(&out[i], &out[i], &inv_len); } } else { diff --git a/src/fft_g1.c b/src/fft_g1.c index bfe01f0..41f4727 100644 --- a/src/fft_g1.c +++ b/src/fft_g1.c @@ -60,7 +60,7 @@ C_KZG_RET fft_g1(blst_p1 *out, blst_p1 *in, FFTSettings *fs, bool inv, uint64_t fr_from_uint64(&inv_len, n); blst_fr_eucl_inverse(&inv_len, &inv_len); fft_g1_fast(out, in, 1, fs->reverse_roots_of_unity, stride, n); - for (uint64_t i = 0; i < fs->max_width; i++) { + for (uint64_t i = 0; i < n; i++) { p1_mul(&out[i], &out[i], &inv_len); } } else {