docs: use derive_key_argon2 in examples, derive_key no longer exists#375
Conversation
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.
| 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"); |
Mathieu Morrissette (MathieuMorrissette)
left a comment
There was a problem hiding this comment.
lgtm
322ade5
into
master
No description provided.