Skip to content

Commit

Permalink
Address Justin's review
Browse files Browse the repository at this point in the history
  • Loading branch information
asn-d6 committed Aug 23, 2024
1 parent c435fc8 commit e68de38
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/eip7594/eip7594.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,13 @@ static C_KZG_RET compute_r_powers_for_verify_cell_kzg_proof_batch(
* @param[in] num_commitments The number of unique commitments
* @param[in] num_cells The number of cells
*/
static C_KZG_RET compute_commitment_sum(
static C_KZG_RET compute_weighted_sum_of_commitments(
g1_t *sum_of_commitments_out,
const Bytes48 *unique_commitments,
const uint64_t *commitment_indices,
const fr_t *r_powers,
size_t num_commitments,
size_t num_cells
uint64_t num_cells
) {
C_KZG_RET ret;
g1_t *commitments_g1 = NULL;
Expand All @@ -491,7 +491,7 @@ static C_KZG_RET compute_commitment_sum(
}

/* Update commitment weights */
for (size_t i = 0; i < num_cells; i++) {
for (uint64_t i = 0; i < num_cells; i++) {
blst_fr_add(
&commitment_weights[commitment_indices[i]],
&commitment_weights[commitment_indices[i]],
Expand Down Expand Up @@ -670,7 +670,7 @@ static C_KZG_RET compute_commitment_to_aggregated_interpolation_poly(
}

/**
* Compute weighted sum of proofs
* Compute weighted sum of proofs.
*
* @param[out] weighted_proof_lincomb The resulting G1 sum of the proofs scaled by coset factors
* @param[in] proofs_g1 Array of G1 elements representing the proofs
Expand All @@ -694,7 +694,7 @@ static C_KZG_RET computed_weighted_sum_of_proofs(
ret = new_fr_array(&weighted_powers_of_r, num_cells);
if (ret != C_KZG_OK) goto out;

for (size_t i = 0; i < num_cells; i++) {
for (uint64_t i = 0; i < num_cells; i++) {
uint64_t pos = reverse_bits_limited(CELLS_PER_EXT_BLOB, cell_indices[i]);
fr_t coset_factor = s->roots_of_unity[pos];
// Compute h_k^n, with h_k and n as in the spec.
Expand Down Expand Up @@ -827,7 +827,7 @@ C_KZG_RET verify_cell_kzg_proof_batch(
// Compute sum of the commitments
////////////////////////////////////////////////////////////////////////////////////////////////

ret = compute_commitment_sum(
ret = compute_weighted_sum_of_commitments(
&final_g1_sum, unique_commitments, commitment_indices, r_powers, num_commitments, num_cells
);
if (ret != C_KZG_OK) goto out;
Expand Down

0 comments on commit e68de38

Please sign in to comment.