perf(sw_emulated): optimize jointScalarMulGeneric #1049
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.
Description
jointScalarMulGeneric
is used to compute[u]P+[v]Q
when the GLV endomorphism is not a available. It was implementing it naively as most of the curves of interest to us have GLV. But users might want for example to verify ECDSA with NIST curves e.g. P-256, P-384 — in which case this PR might come in handy.Type of change
How has this been tested?
Added test
TestJointScalarMul4
andTestJointScalarMulEdgeCases4
(edge casess involving 0-scalars and (0,0)-points) for P-256 curve (no GLV).How has this been benchmarked?
old: 1418482 scs
new: 1186170 scs
Checklist:
golangci-lint
does not output errors locally