Skip to content

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Dec 5, 2025

Splits out PasswordHasher::hash_password_customized into its own separate CustomizedPasswordHasher trait.

This trait retains the associated Params type since that's used as a method argument.

This also adds a type alias Version for u32 to use in place of Decimal (also a u32 alias) for the Version parameter to hash_password_customized, and changes the salt parameter to be &'a str, which removes any PHC-related types as input arguments to the method.

However, there is still a dependency on ParamsString and PasswordHash, which still needs to be addressed to fully decouple the trait from PHC types.

Splits out `PasswordHasher::hash_password_customized` into its own
separate `CustomizedPasswordHasher` trait.

This trait retains the associated `Params` type since that's used as a
method argument.

This also adds a type alias `Version` for `u32` to use in place of
`Decimal` (also a `u32` alias) for the `Version` parameter to
`hash_password_customized`, and changes the `salt` parameter to be
`&'a str`, which removes any PHC-related types as input arguments to the
method.

However, there is still a dependency on `ParamsString` and
`PasswordHash`, which still needs to be addressed to fully decouple the
trait from PHC types.
@tarcieri tarcieri force-pushed the password-hash/split-customized-password-hasher-trait branch from 3d4a89d to 1f0eca0 Compare December 5, 2025 00:26
@tarcieri tarcieri merged commit 85ce438 into master Dec 5, 2025
11 checks passed
@tarcieri tarcieri deleted the password-hash/split-customized-password-hasher-trait branch December 5, 2025 00:31
tarcieri added a commit to RustCrypto/password-hashes that referenced this pull request Dec 5, 2025
Includes updates for the following:
- Extract `phc` submodule (RustCrypto/traits#2103)
- Extract `CustomizedPasswordHasher` trait (RustCrypto/traits#2105)
tarcieri added a commit to RustCrypto/password-hashes that referenced this pull request Dec 5, 2025
Includes updates for the following:
- Extract `phc` submodule (RustCrypto/traits#2103)
- Extract `CustomizedPasswordHasher` trait (RustCrypto/traits#2105)
tarcieri added a commit to RustCrypto/password-hashes that referenced this pull request Dec 5, 2025
Includes updates for the following:
- Extract `phc` submodule (RustCrypto/traits#2103)
- Extract `CustomizedPasswordHasher` trait (RustCrypto/traits#2105)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants