RSA icon indicating copy to clipboard operation
RSA copied to clipboard

https://docs.rs/rsa/latest/rsa/struct.RsaPrivateKey.html#method.precompute is public

Open wez opened this issue 2 years ago • 4 comments

While looking at perf, I noticed this precompute method: https://docs.rs/rsa/latest/rsa/struct.RsaPrivateKey.html#method.precompute

In https://github.com/RustCrypto/RSA/issues/23#issuecomment-525251114 it mentions that this should be private and that it is implicitly called during construction.

That issue was closed, but it seems like this still needs to be resolved

wez avatar Jun 15 '23 23:06 wez

Yeah, it should be removed from the public API. We can at least deprecate it.

tarcieri avatar Jun 16 '23 00:06 tarcieri

I believe that the method should remain public so that users of the PrivateKeyParts trait can know when the different pre-computed values have been prepared (see this Zulip conversation as well). Without it, there's no other guarantees that a instance of RsaPrivateKey has these values available internally since its primarily just an implementation detail. We specifically need it to support "exporting" into a JWK format, which requires all of the additional values.

complexspaces avatar Sep 08 '23 15:09 complexspaces