pub struct KeyDerivationParams {
pub memory_cost: u32,
pub time_cost: u32,
pub parallelism: u32,
pub key_size: u8,
}Expand description
Argon2id parameters for XChacha20-Poly1305 key derivation.
Fields§
§memory_cost: u32§time_cost: u32§parallelism: u32§key_size: u8Implementations§
Source§impl KeyDerivationParams
impl KeyDerivationParams
pub fn new( memory_cost: u32, time_cost: u32, parallelism: u32, key_size: u8, ) -> KeyDerivationParams
Sourcepub fn production_defaults() -> KeyDerivationParams
pub fn production_defaults() -> KeyDerivationParams
Production defaults for Argon2id parameters.
- Memory Cost: 1,048,576 KiB (1 GiB)
- Time Cost: 10 iterations
- Parallelism: 4 threads
- Key Size: 32 bytes (256 bits)
Sourcepub fn test_defaults() -> KeyDerivationParams
pub fn test_defaults() -> KeyDerivationParams
Test defaults for Argon2id parameters.
- Memory Cost: 1,024 KiB (1 MiB)
- Time Cost: 1 iteration
- Parallelism: 1 thread
- Key Size: 32 bytes (256 bits)
Trait Implementations§
Source§impl Clone for KeyDerivationParams
impl Clone for KeyDerivationParams
Source§fn clone(&self) -> KeyDerivationParams
fn clone(&self) -> KeyDerivationParams
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 Debug for KeyDerivationParams
impl Debug for KeyDerivationParams
Source§impl From<SecurityProfile> for KeyDerivationParams
impl From<SecurityProfile> for KeyDerivationParams
Source§fn from(profile: SecurityProfile) -> KeyDerivationParams
fn from(profile: SecurityProfile) -> KeyDerivationParams
Converts to this type from the input type.
Source§impl PartialEq for KeyDerivationParams
impl PartialEq for KeyDerivationParams
impl Eq for KeyDerivationParams
impl StructuralPartialEq for KeyDerivationParams
Auto Trait Implementations§
impl Freeze for KeyDerivationParams
impl RefUnwindSafe for KeyDerivationParams
impl Send for KeyDerivationParams
impl Sync for KeyDerivationParams
impl Unpin for KeyDerivationParams
impl UnwindSafe for KeyDerivationParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more