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.
Description
For our use case of polynomial with small coefficients, we are interested in doing MSMs over small scalars.
For
MAX_BITS = 30
we have a massive 7x performance improvement:versus the naive MSM:
For
MAX_BITS = 60
, we have:This is actually "only" 5x better. Surprisingly, or perhaps not*, this is MUCH better than claimed in Lasso: https://github.com/a16z/Lasso/blob/823da601422d17f7c150631947b33a9db1ad5b98/src/msm/README.md?plain=1#L2
*I think that the claim in Lasso actually refers to the costs of the entire scheme, instead of just MSM.
Also, the interface change is a
little uglyVERY BAD, as the default is almost never respected.Probably we'd need to also add this
const
to swProjective
and all its implementations... it's quickly turning messy, but I don't know if there's a better way.