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

fix(bandersnatch): GLV bounds + test #516

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

yelhousni
Copy link
Collaborator

Description

When we revisited GLV scalar decomposition #213, we increased conditionally the loop bounds by 1 for all mulGLV methods for all curves but we forgot to do so for Bandersnatch twisted Edwards curve. This PR fixes the issue.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

added scalarMulWindowed which does a windowed double-and-add and compares the result with scalarMulGLV which uses the endomorphism. The method ScalarMultiplication picks scalarMulGLV whenever an efficient endomorphism is available (currently only for Bandersnatch).

How has this been benchmarked?

benchmark                          old ns/op     new ns/op     delta
BenchmarkScalarMulExtended-8       30378         30271         -0.35%
BenchmarkScalarMulProjective-8     33844         33941         +0.29%

No major diff for random scalars.

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 added the bug Something isn't working label Jun 27, 2024
@yelhousni yelhousni added this to the v0.10.0 milestone Jun 27, 2024
@yelhousni yelhousni self-assigned this Jun 27, 2024
@yelhousni
Copy link
Collaborator Author

@ThomasPiellard this is just consolidating GLV in twisted Edwards with Weiestrass.

@yelhousni yelhousni requested a review from ivokub July 13, 2024 19:04
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.

LGTM

@gbotrel gbotrel merged commit 6cf8884 into master Jul 18, 2024
7 checks passed
@gbotrel gbotrel deleted the fix/bandersnatch-glv branch July 18, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants