Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In batch cell verification, take commitment for each cell #451

Merged
merged 10 commits into from
Jul 11, 2024
Prev Previous commit
Next Next commit
Add comment
  • Loading branch information
jtraglia committed Jul 3, 2024
commit d989f40577220cb793538c163a36858331852db0
11 changes: 7 additions & 4 deletions src/c_kzg_4844.c
Original file line number Diff line number Diff line change
Expand Up @@ -3803,11 +3803,9 @@ C_KZG_RET verify_cell_kzg_proof_batch(
size_t num_commitments;
void **tmp = NULL;

/* Dedup arrays */
/* Arrays */
Bytes48 *unique_commitments = NULL;
uint64_t *row_indices = NULL;

/* Arrays */
bool *is_cell_used = NULL;
fr_t *aggregated_column_cells = NULL;
fr_t *aggregated_interpolation_poly = NULL;
Expand Down Expand Up @@ -3847,7 +3845,12 @@ C_KZG_RET verify_cell_kzg_proof_batch(
ret = c_kzg_calloc(tmp, num_cells, sizeof(uint64_t));
if (ret != C_KZG_OK) goto out;


/*
* Convert the array of cell commitments to an array of unique commitments
* and an array of indices to those unique commitments. We do this before
* the array allocations section below because we need to know how many
* commitment weights there will be.
*/
num_commitments = num_cells;
memcpy(unique_commitments, commitments_bytes, num_cells * sizeof(Bytes48));
deduplicate_commitments(unique_commitments, row_indices, &num_commitments);
Expand Down