-
Notifications
You must be signed in to change notification settings - Fork 183
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
Implement modular inverse #60
Comments
I second this. I would add that I also have a variant that uses the extended Euclidean algorithm, but it seems to be failing for large negative numbers. |
This will probably be met generically by rust-num/num-integer#10. |
That would be nice, but this should be still implemented in here, as the properly optimized algorithms take into account the actual digits/limbs, which are not available on the generalized |
@dignifiedquire, your link is currently redirecting then returning 404 for me. The RustCrypto/RSA repo doesn't have a src/math.rs, but I can see that it uses a |
yes, that code moved out of the RSA library into my fork of num-bigint into: https://github.com/dignifiedquire/num-bigint/blob/master/src/algorithms/mod_inverse.rs |
I had the need for this and have a variant that works well for positive numbers here, if there is interest: https://github.com/dignifiedquire/rust-rsa/blob/master/src/math.rs#L118
The text was updated successfully, but these errors were encountered: