Skip to content

kdf: Kdf trait documentation improvements#2211

Merged
tarcieri merged 2 commits into
masterfrom
kdf/doc-improvements
Jan 20, 2026
Merged

kdf: Kdf trait documentation improvements#2211
tarcieri merged 2 commits into
masterfrom
kdf/doc-improvements

Conversation

@tarcieri
Copy link
Copy Markdown
Member

Expands documentation and renames the second parameter (not counting self) to the KDF from salt => non_secret.

When impl'ing this trait for hkdf it became clear that, using the existing structs, info was the only parameter that made sense (something @newpavlov hinted at), as salt is the only one that can be statefully configured and accessed via self.

So this renames it to a much more nonspecific non_secret and notes in the documentation that such a parameter goes by many different names that all generally serve the same function: customizing the outputs in a non-correlated/indistinguishable manner.

It suggests consulting the algorithm-specific documentation for what parameter it actually maps to, except for Kdfs marked Pbkdf where it says it always maps to the salt.

Expands documentation and renames the second parameter (not counting
`self`) to the KDF from `salt` => `non_secret`.

When impl'ing this trait for `hkdf` it became clear that, using the
existing structs, `info` was the only parameter that made sense
(something @newpavlov hinted at), as `salt` is the only one that can be
statefully configured and accessed via `self`.

So this renames it to a much more nonspecific `non_secret` and notes in
the documentation that such a parameter goes by many different names
that all generally serve the same function: customizing the outputs in
a non-correlated/indistinguishable manner.

It suggests consulting the algorithm-specific documentation for what
parameter it actually maps to, except for `Kdf`s marked `Pbkdf` where it
says it always maps to the salt.
@tarcieri tarcieri requested a review from newpavlov January 20, 2026 22:29
Comment thread kdf/src/lib.rs Outdated
@tarcieri tarcieri merged commit 2187175 into master Jan 20, 2026
10 checks passed
@tarcieri tarcieri deleted the kdf/doc-improvements branch January 20, 2026 22:51
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