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

[Optimization] Checked Multiplication #2047

Merged

Conversation

d0cd
Copy link
Collaborator

@d0cd d0cd commented Oct 6, 2023

This PR optimizes the checked multiplication circuits in snarkVM by:

  • Efficiently using witnesses to reduce constraints for integers smaller than 128 bits.
  • Use Karatsuba's algorithm.
  • Return flags for overflow, rather than a bit decomposition.

This depends on #2046.

@d0cd d0cd changed the base branch from testnet3 to tracking/circuit-optimizations-and-fixes October 6, 2023 05:01
@d0cd d0cd marked this pull request as ready for review October 10, 2023 18:40
@d0cd d0cd requested review from acoglio, bendyarm and howardwu October 10, 2023 18:42
Copy link
Contributor

@acoglio acoglio left a comment

Choose a reason for hiding this comment

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

Looks good, modulo a possible suggested optimization.

@d0cd d0cd requested a review from bendyarm October 11, 2023 22:04
Copy link
Contributor

@bendyarm bendyarm left a comment

Choose a reason for hiding this comment

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

Looks good!

@d0cd d0cd force-pushed the tracking/circuit-optimizations-and-fixes branch from 59429b5 to 2e4926b Compare October 13, 2023 21:04
@d0cd d0cd force-pushed the optimization/mul-checked branch from d647af7 to b9a1f6a Compare October 13, 2023 21:05
@howardwu howardwu merged commit efe4667 into tracking/circuit-optimizations-and-fixes Oct 14, 2023
@howardwu howardwu deleted the optimization/mul-checked branch October 14, 2023 02:19
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.

4 participants