Skip to content

Commit

Permalink
Clean rust implementation of argon2
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Oct 29, 2024
1 parent b9294c5 commit 94183ab
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/desktop/desktop_native/core/src/crypto/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ pub fn argon2(
use argon2::*;

let params = Params::new(memory, iterations, parallelism, Some(32)).map_err(|e| {
KdfParamError::InvalidParams(format!(
"Argon2 parameters are invalid: {}",
e.to_string()
))
KdfParamError::InvalidParams(format!("Argon2 parameters are invalid: {e}",))
})?;
let argon = Argon2::new(Algorithm::Argon2id, Version::V0x13, params);

Expand All @@ -66,4 +63,4 @@ pub fn argon2(
}
clear_stack();
Ok(hash)
}
}

0 comments on commit 94183ab

Please sign in to comment.