Skip to content

crypto/hash/digest reorganization #7503

Closed
@Seldaek

Description

@Seldaek

Right now extra has md4/sha1/sha2 implemented, yet many more hashing algos exist so I'm thinking consolidating it now might make sense. sha1/sha2 are in extra/crypto/ but exported as extra::{sha1,sha2}, they both implement the Digest trait. md4 is simply in extra/ and has its own API.

Therefore I would like to suggest the following changes (and volunteer to realize them should they be accepted):

  • move extra/md4.rs to extra/crypto/md4.rs and make it implement Digest
  • potentially move all three in an extra::crypto::{md4,sha1,sha2} module, although I'd rather call it extra::hash:: because not all hash algos are to be considered cryptographically secure. Perhaps that is the reason md4 is not in crypto right now, but I think it'd be best to clean this up now before more hashes get added and the BC requirements becomes stronger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions