Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(sw_emulated): optimize jointScalarMulGeneric #1049

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

yelhousni
Copy link
Contributor

@yelhousni yelhousni commented Feb 9, 2024

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

  • New feature (non-breaking change which adds functionality)

How has this been tested?

Added test TestJointScalarMul4 and TestJointScalarMulEdgeCases4 (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:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@yelhousni yelhousni self-assigned this Feb 9, 2024
@yelhousni yelhousni requested a review from ivokub February 9, 2024 14:13
@yelhousni yelhousni added the perf label Feb 9, 2024
@yelhousni yelhousni added this to the v0.9.0 milestone Feb 9, 2024
Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@yelhousni yelhousni merged commit 4c3ef85 into master Feb 9, 2024
7 checks passed
@yelhousni yelhousni deleted the perf/jointScalarMulGeneric branch February 9, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants