Skip to content

RsaPrivateKey should implement Hash #165

Closed

Description

@Erik1000

RsaPublicKey does implement Hash but RsaPrivateKey does not, why? rsa should conform to C-COMMON-TRAITS.

Activity

  1. tarcieri commented on Jul 1, 2022

    @tarcieri
    Member

    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.

  2. tarcieri commented on Jul 1, 2022

    @tarcieri
    Member

    All that said, an approach that could work and generally be safe would be hashing only the public components of RsaPrivateKey.

  3. Erik1000 commented on Jul 1, 2022

    @Erik1000
    Author

    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.

  4. dignifiedquire commented on Oct 9, 2022

    @dignifiedquire
    Member

    As long as we add some prefix, ensuring it hashes to something differently than the Public Key.

  5. added
    enhancement
    on Oct 9, 2022
  6. added a commit that references this issue on Apr 25, 2023
    6649ccd
  7. added a commit that references this issue on Apr 25, 2023
    c012868
  8. added a commit that references this issue on Jan 27, 2026
    d307b34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions