From 30864e643fda674f836001391fb0c9ab454bc4cb Mon Sep 17 00:00:00 2001 From: Ramana Kumar Date: Mon, 3 Oct 2022 20:49:45 +0100 Subject: [PATCH] Remove stride from eval_poly_l To match b611c51874b5bff5958bc1cf1dae7d6c5eca19ac --- src/poly.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/poly.c b/src/poly.c index 78b63cc..a2c1ea3 100644 --- a/src/poly.c +++ b/src/poly.c @@ -112,24 +112,23 @@ void eval_poly(fr_t *out, const poly *p, const fr_t *x) { C_KZG_RET eval_poly_l(fr_t *out, const poly_l *p, const fr_t *x, const FFTSettings *fs) { fr_t tmp, *inverses_in, *inverses; uint64_t i; - const uint64_t stride = fs->max_width / p->length; TRY(new_fr_array(&inverses_in, p->length)); TRY(new_fr_array(&inverses, p->length)); for (i = 0; i < p->length; i++) { - if (fr_equal(x, &fs->bitrevp_roots_of_unity[i * stride])) { + if (fr_equal(x, &fs->bitrevp_roots_of_unity[i])) { *out = p->values[i]; free(inverses_in); free(inverses); return C_KZG_OK; } - fr_sub(&inverses_in[i], x, &fs->bitrevp_roots_of_unity[i * stride]); + fr_sub(&inverses_in[i], x, &fs->bitrevp_roots_of_unity[i]); } TRY(fr_batch_inv(inverses, inverses_in, p->length)); *out = fr_zero; for (i = 0; i < p->length; i++) { - fr_mul(&tmp, &inverses[i], &fs->bitrevp_roots_of_unity[i * stride]); + fr_mul(&tmp, &inverses[i], &fs->bitrevp_roots_of_unity[i]); fr_mul(&tmp, &tmp, &p->values[i]); fr_add(out, out, &tmp); }