docs: use derive_key_argon2 in examples, derive_key no longer exists#375
Open
Sébastien Duquette (sduquette-devolutions) wants to merge 1 commit intomasterfrom
Open
docs: use derive_key_argon2 in examples, derive_key no longer exists#375Sébastien Duquette (sduquette-devolutions) wants to merge 1 commit intomasterfrom
Sébastien Duquette (sduquette-devolutions) wants to merge 1 commit intomasterfrom
Conversation
Copilot started reviewing on behalf of
Sébastien Duquette (sduquette-devolutions)
February 27, 2026 20:44
View session
There was a problem hiding this comment.
Pull request overview
Updates the Rust README examples to reflect the current key-derivation API (derive_key_argon2), replacing the removed derive_key usage.
Changes:
- Replace the README key-derivation example to use
utils::derive_key_argon2. - Switch the example to use
Argon2Parameters::default()for configuration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| use devolutions_crypto::Argon2Parameters; | ||
|
|
||
| let key = b"this is a secret password"; | ||
| let parameters = Argon2Parameters::default(); |
There was a problem hiding this comment.
Argon2Parameters::default() generates a new random salt each time (see struct docs), so derive_key_argon2 will not be reproducible across runs unless the same parameters (especially salt) are persisted/reused. The example should either show setting a stable salt (e.g., via the builder / set_salt) or explicitly mention that callers must store/serialize the parameters to derive the same key later.
Suggested change
| let parameters = Argon2Parameters::default(); | |
| // In a real application, generate a random salt once and persist/reuse the same parameters | |
| // (including the salt) whenever you need to derive the same key again. | |
| let mut parameters = Argon2Parameters::default(); | |
| parameters.set_salt(b"example fixed salt value"); |
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.
No description provided.