Skip to content
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

Consider upstreaming ModInverse trait into num-traits crate #21

Open
BlackHoleFox opened this issue Jun 9, 2020 · 2 comments
Open

Consider upstreaming ModInverse trait into num-traits crate #21

BlackHoleFox opened this issue Jun 9, 2020 · 2 comments

Comments

@BlackHoleFox
Copy link

Currently the rsa crate from RustCrypto uses this forks BigUint so it can perform the needed operations when calculating values and the like. Due to this, yubikey-piv.rs is currently needing to import both this crate and the original, because some X509 certificates use BigUints as well.

Is there anything preventing the ModInverse trait and its functions from being upstreamed via a PR to num-traits?

@dignifiedquire
Copy link
Owner

There is more in this crate (support for memory zeroing, smallvec backend) and last time I attempted to upstream all features it was both slow and not fully successfull, though the u64 limbs eventually made it.

There is also the need to allow minimal work involved copy from and to the internal memory of the numbers, which directly opposes the api design rules of the original crate.

So I fear that for rsa it is quite unlikely that we will be able to switch any time soon. I honestly would try to switch to this crate if you wang to reduce dependencies and try to use the shared num traits for interfaces if possible.

@BlackHoleFox
Copy link
Author

Using the shared traits worked out pretty well, at the cost of once allocation which is negligible. Thanks for the pointer. Do you want me to close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants