You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
tarcieri commentedon Jul 1, 2022
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
Hasheriscore::hash::SipHasheras used by default, as that's a secure PRF. Potential leakage will vary for other algorithms.tarcieri commentedon Jul 1, 2022
All that said, an approach that could work and generally be safe would be hashing only the public components of
RsaPrivateKey.Erik1000 commentedon Jul 1, 2022
That should work I guess.
dignifiedquire commentedon Oct 9, 2022
As long as we add some prefix, ensuring it hashes to something differently than the Public Key.
Impl `core::hash::Hash` for `RsaPrivateKey`
Impl `core::hash::Hash` for `RsaPrivateKey` (#308)
Impl `core::hash::Hash` for `RsaPrivateKey` (RustCrypto#308)