Skip to content

Commit

Permalink
remove TODO in cosets module (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Aug 14, 2024
1 parent ef5afaa commit 4f663bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cryptography/kzg_multi_open/src/fk20/cosets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ pub fn coset_gens(num_points: usize, num_cosets: usize, bit_reversed: bool) -> V
use bls12_381::ff::Field;

// Compute the generator for the group containing all of the points.
// TODO: generating the whole group, just to get the generator is inefficient
//
// Note: generating the whole group, just to get the generator is inefficient
// However, this code is not on the hot path, so we don't optimize it.
let domain = Domain::new(num_points);
let coset_gen = domain.generator;

Expand All @@ -52,7 +54,8 @@ pub fn coset_gens(num_points: usize, num_cosets: usize, bit_reversed: bool) -> V
let mut coset_gens = Vec::new();
for i in 0..num_cosets {
let generator = if bit_reversed {
// TODO: We could just bit-reverse the `coset_gens` method instead
// Note: We could bit-reverse the `coset_gens` vector instead
// instead of bit-reversing the exponent.
let rev_i = reverse_bits(i, log2(num_cosets as u32)) as u64;
coset_gen.pow_vartime([rev_i])
} else {
Expand Down

0 comments on commit 4f663bc

Please sign in to comment.