Merged
Conversation
765821c to
6be13af
Compare
tarcieri
added a commit
to RustCrypto/password-hashes
that referenced
this pull request
Dec 9, 2025
Companion PR to RustCrypto/traits#2116 The `phc` crate was recently extracted from the `password-hash` crate, implementing the Password Hashing Competition (PHC) string format for storing password hashes. This also factored apart the error types so there are separate ones for `phc::Error` and `password_hash::Error`, which is the primary source of changes in this PR.
tarcieri
added a commit
to RustCrypto/password-hashes
that referenced
this pull request
Dec 9, 2025
Companion PR to RustCrypto/traits#2116 The `phc` crate was recently extracted from the `password-hash` crate, implementing the Password Hashing Competition (PHC) string format for storing password hashes. This also factored apart the error types so there are separate ones for `phc::Error` and `password_hash::Error`, which is the primary source of changes in this PR.
tarcieri
added a commit
to RustCrypto/password-hashes
that referenced
this pull request
Dec 9, 2025
Companion PR to RustCrypto/traits#2116 The `phc` crate was recently extracted from the `password-hash` crate, implementing the Password Hashing Competition (PHC) string format for storing password hashes. This also factored apart the error types so there are separate ones for `phc::Error` and `password_hash::Error`, which is the primary source of changes in this PR.
tarcieri
added a commit
to RustCrypto/password-hashes
that referenced
this pull request
Dec 9, 2025
Companion PR to RustCrypto/traits#2116 The `phc` crate was recently extracted from the `password-hash` crate, implementing the Password Hashing Competition (PHC) string format for storing password hashes. This also factored apart the error types so there are separate ones for `phc::Error` and `password_hash::Error`, which is the primary source of changes in this PR.
tarcieri
added a commit
to RustCrypto/password-hashes
that referenced
this pull request
Dec 9, 2025
Companion PR to RustCrypto/traits#2116 The `phc` crate was recently extracted from the `password-hash` crate, implementing the Password Hashing Competition (PHC) string format for storing password hashes. This also factored apart the error types so there are separate ones for `phc::Error` and `password_hash::Error`, which is the primary source of changes in this PR.
Replaces the `phc` submodule with a re-export of the `phc` crate. A dependency on the crate is needed to make the blanket impl of `PasswordVerifier` for `PasswordHasher` work (notably the former is object safe, and a similar blanket impl can't be supported for MCF since algorithm-specific rules are required) This also significantly simplifies the `Error` type now that it's only responsible for errors involving the traits, rather than errors from parsing password hashes.
6be13af to
42acd52
Compare
phc cratephc crate
tarcieri
commented
Dec 9, 2025
Comment on lines
+24
to
+40
| /// Output size invalid. | ||
| OutputSize, | ||
|
|
||
| /// Invalid named parameter. | ||
| ParamInvalid { | ||
| /// Parameter name. | ||
| name: &'static str, | ||
| }, | ||
|
|
||
| /// Invalid parameters. | ||
| ParamsInvalid, | ||
|
|
||
| /// Invalid password. | ||
| PasswordInvalid, | ||
|
|
||
| /// Invalid salt. | ||
| SaltInvalid, |
Member
Author
There was a problem hiding this comment.
Note: several of these are significantly less fine-grained, notably you can't tell whether salts and outputs are too small or too big. Hopefully people can figure it out from context, though we may consider adding it back.
The ParamInvalid error should be a significant improvement in that it informs you exactly which parameter was invalid (although perhaps does a poor job of telling you why)
tarcieri
added a commit
to RustCrypto/password-hashes
that referenced
this pull request
Dec 9, 2025
Companion PR to RustCrypto/traits#2116 The `phc` crate was recently extracted from the `password-hash` crate, implementing the Password Hashing Competition (PHC) string format for storing password hashes. This also factored apart the error types so there are separate ones for `phc::Error` and `password_hash::Error`, which is the primary source of changes in this PR.
tarcieri
added a commit
to RustCrypto/password-hashes
that referenced
this pull request
Dec 9, 2025
Companion PR to RustCrypto/traits#2116 The `phc` crate was recently extracted from the `password-hash` crate, implementing the Password Hashing Competition (PHC) string format for storing password hashes. This also factored apart the error types so there are separate ones for `phc::Error` and `password_hash::Error`, which is the primary source of changes in this PR.
Merged
tarcieri
added a commit
that referenced
this pull request
Mar 10, 2026
## Added - Generic `H` param to traits to support multiple string formats e.g. PHC, MCF (#2110) - Implement `From<phc::Error>` for `Error` (#2124) - `rand_core` feature (#2126) - Salt generating helper functions `(try_)generate_salt` (#2128) - `Error::RngFailure` variant (#2337) ## Changed - Edition changed to 2024 and MSRV bumped to 1.85 (#1759) - Extract `CustomizedPasswordHasher` trait (#2105) - Bump `getrandom` to v0.4 (#2258) ## Removed - `Encoding` enum (#2102) - PHC types moved to the `phc` crate, which is re-exported as `password_hash::phc` when the `phc` crate feature is enabled (#2103, #2116): - `Ident` - `Output` - `ParamsString` - `PasswordHash` - `PasswordHashString` - `Salt` - `SaltString` - `Value` - `McfHasher` trait (#2334)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the
phcsubmodule with a re-export of thephccrate, which was just extracted from thepassword-hashcrate in RustCrypto/formats#2111.A dependency on the crate is needed to make the blanket impl of
PasswordVerifierforPasswordHasherwork (notably the former is object safe, and a similar blanket impl can't be supported for MCF since algorithm-specific rules are required)This also significantly simplifies the
Errortype now that it's only responsible for errors involving the traits, rather than errors from parsing password hashes.