pub struct Argon2Params {
pub m_cost: u32,
pub t_cost: u32,
pub p_cost: u32,
pub output_len: usize,
}Available on (crate features
kdf-hkdf or kdf-argon2) and crate feature kdf-argon2 only.Expand description
Tuneable Argon2id parameters.
Construct via Argon2Params::default (OWASP-recommended, ~100 ms
on a modern CPU) or via Argon2Params::new for custom values.
m_cost: memory cost in kibibytes (1 unit = 1024 bytes).t_cost: number of iterations (time cost).p_cost: parallelism / lanes.output_len: derived-key length in bytes; defaults to 32.
Reducing any parameter reduces resistance to brute-force; the defaults are tuned for “human authentication” (login flows). For machine-to-machine credentials a higher memory/time cost is appropriate.
Fields§
§m_cost: u32Memory cost in kibibytes.
t_cost: u32Time cost (iterations).
p_cost: u32Parallelism (number of lanes).
output_len: usizeDerived-key length in bytes.
Implementations§
Trait Implementations§
Source§impl Clone for Argon2Params
impl Clone for Argon2Params
Source§fn clone(&self) -> Argon2Params
fn clone(&self) -> Argon2Params
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Argon2Params
impl Debug for Argon2Params
Source§impl Default for Argon2Params
impl Default for Argon2Params
Source§impl PartialEq for Argon2Params
impl PartialEq for Argon2Params
Source§fn eq(&self, other: &Argon2Params) -> bool
fn eq(&self, other: &Argon2Params) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Argon2Params
impl Eq for Argon2Params
impl StructuralPartialEq for Argon2Params
Auto Trait Implementations§
impl Freeze for Argon2Params
impl RefUnwindSafe for Argon2Params
impl Send for Argon2Params
impl Sync for Argon2Params
impl Unpin for Argon2Params
impl UnsafeUnpin for Argon2Params
impl UnwindSafe for Argon2Params
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