Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Keystore/ScryptParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ ScryptParameters::ScryptParameters(const nlohmann::json& json) {
desiredKeyLength = json[CodingKeys::SP::desiredKeyLength];
if (json.count(CodingKeys::SP::n) != 0)
n = json[CodingKeys::SP::n];
if (json.count(CodingKeys::SP::n) != 0)
if (json.count(CodingKeys::SP::p) != 0)
p = json[CodingKeys::SP::p];
if (json.count(CodingKeys::SP::n) != 0)
if (json.count(CodingKeys::SP::r) != 0)
r = json[CodingKeys::SP::r];
Comment on lines +78 to 81
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix correctly addresses the copy-paste bug where p and r parameters were checking the wrong JSON key (n instead of their respective keys). However, there is no test coverage that specifically validates the conditional parsing behavior when p or r keys are missing from JSON. Consider adding a unit test that verifies the default values are used when these keys are absent, and that custom values are correctly parsed when present.

Copilot uses AI. Check for mistakes.
}

Expand Down
Loading