Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperhulk committed Nov 11, 2024
1 parent 6c34c78 commit 8ea21b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rust/src/backend/kdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl Argon2id {
));
}

if salt.extract::<&[u8]>(py)?.len() < 8 {
if salt.as_bytes(py).len() < 8 {
return Err(CryptographyError::from(
pyo3::exceptions::PyValueError::new_err(
"salt must be at least 8 bytes"
Expand Down Expand Up @@ -253,7 +253,7 @@ impl Argon2id {
));
}

if memory_cost < 8 * lanes {
if memory_cost / 8 < lanes {
return Err(CryptographyError::from(
pyo3::exceptions::PyValueError::new_err(
"memory_cost must be an integer >= 8 * lanes."
Expand Down

0 comments on commit 8ea21b6

Please sign in to comment.