pub struct PasswordHashVerificationLimits { /* private fields */ }Expand description
Absolute resource limits accepted when verifying a stored Argon2id PHC string.
Values below the current work factor remain valid for compatibility and are reported through
PasswordHashVerification::needs_rehash. Values above these limits are rejected before the
Argon2 work-memory allocation begins.
Implementations§
Source§impl PasswordHashVerificationLimits
impl PasswordHashVerificationLimits
Sourcepub fn new(
max_memory_kib: u32,
max_iterations: u32,
max_parallelism: u32,
max_output_length: usize,
) -> Result<Self>
pub fn new( max_memory_kib: u32, max_iterations: u32, max_parallelism: u32, max_output_length: usize, ) -> Result<Self>
Creates custom absolute verification limits.
§Errors
Returns an error when any limit is below the Argon2 minimum or the output-length limit is outside the range accepted by the password-hash encoding.
Sourcepub const fn max_memory_kib(self) -> u32
pub const fn max_memory_kib(self) -> u32
Maximum accepted memory cost in KiB.
Sourcepub const fn max_iterations(self) -> u32
pub const fn max_iterations(self) -> u32
Maximum accepted number of Argon2 passes.
Sourcepub const fn max_parallelism(self) -> u32
pub const fn max_parallelism(self) -> u32
Maximum accepted number of Argon2 lanes.
Sourcepub const fn max_output_length(self) -> usize
pub const fn max_output_length(self) -> usize
Maximum accepted password-hash output length in bytes.
Trait Implementations§
Source§impl Clone for PasswordHashVerificationLimits
impl Clone for PasswordHashVerificationLimits
Source§fn clone(&self) -> PasswordHashVerificationLimits
fn clone(&self) -> PasswordHashVerificationLimits
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PartialEq for PasswordHashVerificationLimits
impl PartialEq for PasswordHashVerificationLimits
Source§fn eq(&self, other: &PasswordHashVerificationLimits) -> bool
fn eq(&self, other: &PasswordHashVerificationLimits) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PasswordHashVerificationLimits
impl Eq for PasswordHashVerificationLimits
impl StructuralPartialEq for PasswordHashVerificationLimits
Auto Trait Implementations§
impl Freeze for PasswordHashVerificationLimits
impl RefUnwindSafe for PasswordHashVerificationLimits
impl Send for PasswordHashVerificationLimits
impl Sync for PasswordHashVerificationLimits
impl Unpin for PasswordHashVerificationLimits
impl UnwindSafe for PasswordHashVerificationLimits
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