-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add Montgomery u32 backend for BabyBear #948
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #948 +/- ##
==========================================
+ Coverage 71.14% 71.34% +0.19%
==========================================
Files 153 155 +2
Lines 33129 33519 +390
==========================================
+ Hits 23570 23913 +343
- Misses 9559 9606 +47 ☔ View full report in Codecov by Sentry. |
/// | ||
/// Converts a value from Montgomery domain using reductions mod p | ||
#[inline(always)] | ||
const fn monty_reduce(x: u64, mu: &u32, q: &u32) -> u32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think better name is montgomery_reduction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Renamed in 32ed5e3
Add Montgomery u32 backend for BabyBear
Description
This PR implements a 32-bit Montgomery arithmetic backend for BabyBear finite field operations.
These operations show significant performance improvements versus the actual u64 backend.
Performance parity with Plonky3 is achieved
Results for 1.000.000 operations
Type of change
Checklist