Make compute_powers easier to read

This commit is contained in:
Ramana Kumar 2022-11-18 22:20:18 +00:00
parent 2745c54711
commit 27f772402e
No known key found for this signature in database
GPG Key ID: ED471C788B900433
1 changed files with 3 additions and 3 deletions

View File

@ -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]) {