diff --git a/Cargo.toml b/Cargo.toml index c4e7658..49994b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ serde = ["dep:serde", "generic-array/serde", "voprf/serde"] std = ["dep:getrandom"] [dependencies] -argon2 = { version = "0.4", default-features = false, features = [ +argon2 = { version = "0.5", default-features = false, features = [ "alloc", ], optional = true } curve25519-dalek = { version = "=4.0.0-rc.1", default-features = false, features = [ diff --git a/src/ksf.rs b/src/ksf.rs index 4af2415..677c75c 100644 --- a/src/ksf.rs +++ b/src/ksf.rs @@ -11,10 +11,6 @@ use generic_array::{ArrayLength, GenericArray}; use crate::errors::InternalError; -/// Recommended salt length for argon2-based password hashing. -#[cfg(feature = "argon2")] -const ARGON2_RECOMMENDED_SALT_LEN: usize = 16; - /// Used for the key stretching function in OPAQUE pub trait Ksf: Default { /// Computes the key stretching function @@ -44,7 +40,7 @@ impl Ksf for argon2::Argon2<'_> { input: GenericArray, ) -> Result, InternalError> { let mut output = GenericArray::default(); - self.hash_password_into(&input, &[0; ARGON2_RECOMMENDED_SALT_LEN], &mut output) + self.hash_password_into(&input, &[0; argon2::RECOMMENDED_SALT_LEN], &mut output) .map_err(|_| InternalError::KsfError)?; Ok(output) }