-
Notifications
You must be signed in to change notification settings - Fork 60
Implement safegcd-bounds
#634
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
Comments
Even more details here. The current impl results in the following bounds (obtained by just printing out the iteration count while running the crate test suite, sampling the smallest and biggest iteration counts seen):
The improved CT algorithm results in 590 iterations for 256 bit; extrapolated to bigger sizes would mean 2360 iters for |
Though perhaps we should just go full binary GCD: #755 |
This is a corresponding tracking issue for this TODO: https://github.com/RustCrypto/crypto-bigint/blob/ae30093/src/modular/safegcd.rs#L341
The bounds we currently implement for Bernstein-Yang are the ones described in the paper, which proves that the algorithm will always converge within the prescribed bounds. However, the bounds are overly conservative and not optimal:
https://github.com/sipa/safegcd-bounds
There is both an improved bounds calculation we can use, as well as an improved divsteps algorithm (
hddivsteps
) which itself has improved bounds over the original divsteps algorithm.The text was updated successfully, but these errors were encountered: