In batch cell verification, check if there are zero cells

This commit is contained in:
Justin Traglia 2024-07-05 15:31:07 -05:00
parent 9be05296fa
commit 228752c0d9
1 changed files with 4 additions and 1 deletions

View File

@ -511,6 +511,10 @@ def verify_cell_kzg_proof_batch_impl(row_commitments: Sequence[KZGCommitment],
n = FIELD_ELEMENTS_PER_CELL
num_rows = len(row_commitments)
# Given zero cells, the result is true
if num_cells == 0:
return True
# Step 1: Compute a challenge r and its powers r^0, ..., r^{num_cells-1}
r = compute_verify_cell_kzg_proof_batch_challenge(
row_commitments,
@ -567,7 +571,6 @@ def verify_cell_kzg_proof_batch_impl(row_commitments: Sequence[KZGCommitment],
]))
```
### Cell cosets
#### `coset_shift_for_cell`