-
Notifications
You must be signed in to change notification settings - Fork 147
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
Fix limb count heuristics #803
Conversation
One note here: with the loose bounds multiplier set to 3, some nice possibilities (like 16-limb p448 on 32-bit) are excluded due to overflow. I double checked and it does indeed seem the bounds are too loose in that case (but not with the bounds multiplier set to 2). |
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.
Nice, thanks!
This seems potentially like an argument in favor of #799 (cc @andres-erbsen ) |
Should we add test-cases for this? |
Yes. I vote for just including a solinas multi-tap prime on our generated
code tests (the smallest one I quoted there, 2^192 - 2^64 - 1, would be a
nice compact one.)
|
Oh, heh, I was thinking of doing tests for all of the primes. The first 40 (out of the 80 in the primes list) take about 30 seconds in |
Does the first 40 include many multi-tap ones, though? iirc they were mostly towards the end of the list. |
Oh, indeed, the multitap primes are the final 19. But we can do all of these primes in 2.027 seconds in the native compiler. So maybe we have as a test the first 30 and the last 19? |
Sure, although keep in mind the primes with huge coefficients on their multi-taps are designed for Montgomery and might correctly not have any options for limb counts. |
Hm, unfortunately, with this PR, the computation is much, much slower. So I guess we can't get all of them... |
Btw, |
(All of the "two taps, golden ratio" primes get possibilities generated for them, though it takes 50s to generate all the possibilities) |
Fixes #801
Tests: