ethereum / c-kzg-4844

A minimal implementation of the Polynomial Commitments API for EIP-4844 and EIP-7594, written in C.
Apache License 2.0
112 stars 105 forks source link

`verify_cell_kzg_proof_batch()`: Abstract commitment to interpolation poly #494

Closed asn-d6 closed 1 month ago

asn-d6 commented 1 month ago

After a bunch of failed attempts to simplify verify_cell_kzg_proof_batch(), I found a good spot to apply a scalpel.

This refactoring is fairly clean and moves away four allocations from the main function into a smaller contained function.

The first commit only moves code (can be verified with git diff --color-moved) while the second applies a few minor changes.

There is a few more minor improvements that can be done, but they all have drawbacks. This seems quite clean IMO.