Skip to content

Commit

Permalink
Optimize away a blst_fr_eucl_inverse call
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia committed Sep 16, 2024
1 parent 2c03989 commit 1c67090
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/eip4844/eip4844.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ static bool fr_is_zero(const fr_t *p) {
* @param[in] a A vector of field elements, length `len`
* @param[in] len The number of field elements
*
* @remark This function only supports len > 0.
* @remark This function does NOT support in-place computation.
* @remark Return C_KZG_BADARGS if a zero is found in the input. In this case,
* the `out` output array has already been mutated.
Expand Down
5 changes: 2 additions & 3 deletions src/eip7594/eip7594.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,8 @@ static C_KZG_RET compute_commitment_to_aggregated_interpolation_poly(

/* Now divide by the coset shift factor */
uint64_t pos = reverse_bits_limited(CELLS_PER_EXT_BLOB, i);
fr_t inv_coset_factor;
blst_fr_eucl_inverse(&inv_coset_factor, &s->roots_of_unity[pos]);
shift_poly(column_interpolation_poly, FIELD_ELEMENTS_PER_CELL, &inv_coset_factor);
uint64_t idx = FIELD_ELEMENTS_PER_EXT_BLOB - pos % FIELD_ELEMENTS_PER_EXT_BLOB;
shift_poly(column_interpolation_poly, FIELD_ELEMENTS_PER_CELL, &s->roots_of_unity[idx]);

/* Update the aggregated poly */
for (size_t k = 0; k < FIELD_ELEMENTS_PER_CELL; k++) {
Expand Down

0 comments on commit 1c67090

Please sign in to comment.