pub struct Params<const S: usize>where
Salt<S>: Argon2Compatible,{
pub argon_type: Algorithm,
pub version: u32,
pub memory_cost: u32,
pub time_cost: u32,
pub parallelism: u32,
pub output_len: usize,
pub salt: Salt<S>,
pub ad: Option<Zeroizing<Vec<u8>>>,
pub secret: Option<Zeroizing<Vec<u8>>>,
}
Expand description
Parameters for the Argon2 password hashing function
Argon2 is configurable with several parameters that affect its memory and time cost. This struct encapsulates all the parameters needed to control the behavior of the algorithm.
Fields§
§argon_type: Algorithm
The Argon2 variant to use (Argon2d, Argon2i, or Argon2id)
version: u32
The Argon2 version (should be 0x13 for v1.3)
memory_cost: u32
Memory usage in kibibytes (KiB)
time_cost: u32
Number of iterations (time cost parameter)
parallelism: u32
Degree of parallelism (number of threads)
output_len: usize
Length of the output hash in bytes
salt: Salt<S>
Salt value for this hash operation
ad: Option<Zeroizing<Vec<u8>>>
Optional associated data that will be included in the hash calculation
secret: Option<Zeroizing<Vec<u8>>>
Optional secret value that can be used as an additional input
Trait Implementations§
Auto Trait Implementations§
impl<const S: usize> Freeze for Params<S>
impl<const S: usize> RefUnwindSafe for Params<S>
impl<const S: usize> Send for Params<S>
impl<const S: usize> Sync for Params<S>
impl<const S: usize> Unpin for Params<S>
impl<const S: usize> UnwindSafe for Params<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more