RSA
RSA copied to clipboard
`RsaPrivateKey` should implement `Hash`
RsaPublicKey
does implement Hash
but RsaPrivateKey
does not, why? rsa
should conform to C-COMMON-TRAITS
.
This would expose private key material to an instance of core::hash::Hasher
, which is not necessarily guaranteed to operate on the key material in constant-time.
It should be fine if the Hasher
is core::hash::SipHasher
as used by default, as that's a secure PRF. Potential leakage will vary for other algorithms.
All that said, an approach that could work and generally be safe would be hashing only the public components of RsaPrivateKey
.
All that said, an approach that could work and generally be safe would be hashing only the public components of RsaPrivateKey.
That should work I guess.
As long as we add some prefix, ensuring it hashes to something differently than the Public Key.