Skip to content

password-hash: remove Display/FromStr bounds on Params#2212

Merged
tarcieri merged 1 commit intomasterfrom
password-hash/remove-str-bounds-on-params
Jan 21, 2026
Merged

password-hash: remove Display/FromStr bounds on Params#2212
tarcieri merged 1 commit intomasterfrom
password-hash/remove-str-bounds-on-params

Conversation

@tarcieri
Copy link
Member

For the associated type CustomizedPasswordHasher::Params, removes the Display and FromStr bounds which aren't actually used: for PHC-related purposes which are the only ones implemented directly in password-hash, it instead requires a TryFrom<phc::ParamsString> impl instead.

Requiring these as well seemed like good hygiene so there's some way to serialize and parse the params as a string, but it becomes a problem when the params are shared between e.g. PHC and MCF implementations where each of them has a different params serialization so there's not one "true" serialization for which it actually makes sense to impl Display and FromStr.

For the associated type `CustomizedPasswordHasher::Params`, removes the
`Display` and `FromStr` bounds which aren't actually used: for
PHC-related purposes which are the only ones implemented directly in
`password-hash`, it instead requires a `TryFrom<phc::ParamsString>`
impl instead.

Requiring these as well seemed like good hygiene so there's some way to
serialize and parse the params as a string, but it becomes a problem
when the params are shared between e.g. PHC and MCF implementations
where each of them has a different params serialization so there's not
one "true" serialization for which it actually makes sense to impl
`Display` and `FromStr`.
@tarcieri tarcieri force-pushed the password-hash/remove-str-bounds-on-params branch from b87befd to 1431835 Compare January 20, 2026 23:22
@tarcieri tarcieri merged commit f57ec3b into master Jan 21, 2026
11 checks passed
@tarcieri tarcieri deleted the password-hash/remove-str-bounds-on-params branch January 21, 2026 00:07
tarcieri added a commit that referenced this pull request Jan 22, 2026
For the associated type `CustomizedPasswordHasher::Params`, removes the
`Display` and `FromStr` bounds which aren't actually used: for
PHC-related purposes which are the only ones implemented directly in
`password-hash`, it instead requires a `TryFrom<phc::ParamsString>` impl
instead.

Requiring these as well seemed like good hygiene so there's some way to
serialize and parse the params as a string, but it becomes a problem
when the params are shared between e.g. PHC and MCF implementations
where each of them has a different params serialization so there's not
one "true" serialization for which it actually makes sense to impl
`Display` and `FromStr`.
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.

1 participant