Skip to content

Commit

Permalink
fix consistency pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad0 committed Feb 12, 2024
1 parent 4313e8b commit 063a902
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,9 +906,8 @@ std::vector<affine_element<Fq, Fr, T>> element<Fq, Fr, T>::batch_mul_with_endomo
return results;
}

constexpr size_t lookup_size = 8;
constexpr size_t num_rounds = 32;
constexpr size_t num_wnaf_bits = 4;
constexpr size_t LOOKUP_SIZE = 8;
constexpr size_t NUM_ROUNDS = 32;
std::array<std::vector<affine_element>, lookup_size> lookup_table;
for (auto& table : lookup_table) {
table.resize(num_points);
Expand All @@ -935,7 +934,7 @@ std::vector<affine_element<Fq, Fr, T>> element<Fq, Fr, T>::batch_mul_with_endomo

// Construct lookup table
batch_affine_double(&temp_point_vector[0]);
for (size_t j = 1; j < lookup_size; ++j) {
for (size_t j = 1; j < LOOKUP_SIZE; ++j) {
run_loop_in_parallel_if_effective(
num_points,
[j, &lookup_table](size_t start, size_t end) {
Expand Down Expand Up @@ -997,7 +996,7 @@ std::vector<affine_element<Fq, Fr, T>> element<Fq, Fr, T>::batch_mul_with_endomo
// First cycle of addition
batch_affine_add_internal(&temp_point_vector[0], &work_elements[0]);
// Run through SM logic in wnaf form (excluding the skew)
for (size_t j = 2; j < num_rounds * 2; ++j) {
for (size_t j = 2; j < NUM_ROUNDS * 2; ++j) {
wnaf_entry = wnaf.table[j];
index = wnaf_entry & 0x0fffffffU;
sign = static_cast<bool>((wnaf_entry >> 31) & 1);
Expand Down

0 comments on commit 063a902

Please sign in to comment.