From 27f772402e44bc169c709884f735070973e87f30 Mon Sep 17 00:00:00 2001 From: Ramana Kumar Date: Fri, 18 Nov 2022 22:20:18 +0000 Subject: [PATCH] Make compute_powers easier to read --- src/c_kzg_4844.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/c_kzg_4844.c b/src/c_kzg_4844.c index 18f9cf9..befc81b 100644 --- a/src/c_kzg_4844.c +++ b/src/c_kzg_4844.c @@ -826,9 +826,9 @@ void free_trusted_setup(KZGSettings *s) { } static void compute_powers(fr_t out[], uint64_t n) { - uint64_t i = 0; - out[i++] = fr_one; - while (++i < n) fr_mul(&out[i], &out[i-1], &out[1]); + out[0] = fr_one; + for (uint64_t i = 2; i < n; i++) + fr_mul(&out[i], &out[i-1], &out[1]); } void bytes_to_bls_field(BLSFieldElement *out, const uint8_t bytes[32]) {