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

optim: avoid div in millerLoopAndFinalExpResult #1363

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

shramee
Copy link
Contributor

@shramee shramee commented Dec 18, 2024

Description

Super minor optimisation to replace a div with a mul, for exponentiation by λ' = q^3 - q^2 + q. We already have the inv so we can just exp the inverse by q^2 and mul (instead of exp and div).

How has this been tested?

  • Ran all the tests and benches

@ivokub ivokub requested a review from yelhousni December 18, 2024 23:51
@ivokub
Copy link
Collaborator

ivokub commented Dec 18, 2024

cc @yelhousni , see also #1347 (reply in thread)

Copy link
Contributor

@yelhousni yelhousni left a comment

Choose a reason for hiding this comment

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

Thanks for spotting it 👍
Indeed it saves 1585 scs corresponding to the equality check in the hinted DivUnchecked.

@yelhousni yelhousni merged commit 3729f22 into Consensys:master Dec 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants