groth16: filter points at infinity in setup #130
Merged
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.
fixes:
groth16.Prove
withforce=true
wasn't doing much since msm with zeroes don't do much.perf:
groth16.Setup
producespk.G1.A
,pk.G1.B
andpk.G2.B
, derived from the QAP. However, if a variable doesn't appear in a QAP column, the value of the corresponding interpolation vector is 0, and the resulting point in the proving key is infinity.Additionally,
frontend.newR1C
will put the variable with the longest linear expression in theA
part of the QAP, maximizing the number of zeroes in theB
part.In one internal circuit, using a lot of
MiMC
, this speeds upgroth16.Prove
by ~30%.