refactor: Improve Spartan SNARK polynomial computations and evaluations #293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This gathers the changes to the pre-processing SNARK excerpted from the Supernova implementation in PR #283. The main changes extracted here are the introduction of the masked eq polynomial (and its use fixing this issue), additional sum-check tooling, removal of two calls to evaluation argument.
Main reference Arecibo PRs:
snark.rs: factor out batch evaluation Sumcheck lurk-lang/arecibo#106CompressedSNARKlurk-lang/arecibo#131supernova::CompressedSNARKlurk-lang/arecibo#174More details (click to expand)
squaresfunction and change in the generation oft_powin Spartan.MaskedEqPolynomialwith methods for its creation and evaluation.UniPolystruct by addition ofPartialEq, andEqtraits.snark.rsfor proving and verifying batch evaluation claims, leveraginggammaandrhofor random linear combinations, and optimizing various variable computations.multilinear.rswith refactoring, optimization, error handling, and supplementing unit tests.spartan/mod.rswith import updates, function overhauls, struct visibility changes, and asynchronous operations for efficient calculations.sumcheck.rsfor batch verification, handling of vectors of claims, handling of cubic bounds with additive terms, visibility adjustments, and typo fixes.eq.rsincluding a debug derive forEqPolynomial, enhanced visibility ofrvector, provision ofevals_from_pointsfor enhanced evaluation, and addition ofFromIteratorimplementation.