Skip to content

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
lucasmenendez pushed a commit to lucasmenendez/gnark that referenced this pull request Jan 31, 2025
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