-
Notifications
You must be signed in to change notification settings - Fork 331
create a fast modular exponent function #209
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
Conversation
this function run in log(N) time complexity and log(N) space complexity to find the modular exponent and can be used cryptographic encryption to find the modular exponent of a really large prime numer
how much faster it is than the built-in I've done some quick benchmarks and it's at least 4 times slower with the native ints on python3, do you see something different? |
removed an extra for loop and merge its content in first loop so must increase performance
now made some tweeks might be faster now |
now it doesn't work, also, it is slower than
|
now this is fast please review this code
|
it's also providing incorrect result:
|
|
|
this function run in log(N) time complexity and log(N) space complexity to find the modular exponent and can be used cryptographic encryption to find the modular exponent of a really large prime numer