-
Notifications
You must be signed in to change notification settings - Fork 185
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
[WIP] Add an example of generating large primes #33
base: master
Are you sure you want to change the base?
Conversation
My attempts to stay in the Montgomery domain haven't made any difference. The bottleneck is in the actual exponentiation. But I think the first witness of 2 could do a lot better optimized as shifts instead. It's something to try, anyway... |
Meh. I tried shifting the base up to the size of the modulus, but for N-bit exponent and modulus, this only reduces the number of iterations by log N. |
hey, this might be of interest to you. I am implementing rsa in rust using this library, porting straight from the golang stdlib as a starting point. I have ported the prime tests already, and getting these numbers. Source: https://github.com/dignifiedquire/rust-rsa/blob/master/src/prime.rs The benchmarks are a 1-1 port, using the same numbers so results should be comparable well. Rust
golang
PS: using a fork as I am missing access to raw limbs, trailing zeros and the |
This example generates large
BigUint
s, then tests for primality.This is marked WIP because I see a few ways I hope to make this faster by making
is_prime
part of the API, and improving the implementation with internal details -- like leveragingmodpow
's Montgomery domain more.