-
Notifications
You must be signed in to change notification settings - Fork 5
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 binary GCD #54
Add binary GCD #54
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #54 +/- ##
==========================================
+ Coverage 99.33% 99.34% +0.01%
==========================================
Files 9 9
Lines 1344 1369 +25
==========================================
+ Hits 1335 1360 +25
Misses 9 9 ☔ View full report in Codecov by Sentry. |
Not for this PR, but I wonder if we can use binary GCD to calculate the Jacobi symbol too. It should have more performance impact since it's called more often during Lucas test, although probably still not too much. |
Also, again not for this PR, but there's a note in
Worth checking out since GCD is available in |
@fjarri Is this good to go? |
Adds binary GCD to the final step of our
gcd_vartime
.The speedup is real but marginal.
Before:
After:
The true goal here was to compare our own gcd implementation to that of
crypto-bigint
. If the two are comparable then we could perhaps get rid of some code. Sadly that is not the case (at all), given our second operand is aWord
(akau64
) I do not think the performance difference is due to any inefficiency we can address easily. The difference is one to two orders of magnitude.