pub struct Context<'o, 'p, 'sa, 'se, 'ad> {
pub out: &'o mut [u8],
pub pwd: Option<&'p mut [u8]>,
pub salt: Option<&'sa mut [u8]>,
pub secret: Option<&'se mut [u8]>,
pub ad: Option<&'ad mut [u8]>,
pub t_cost: u32,
pub m_cost: u32,
pub lanes: u32,
pub threads: u32,
pub version: Version,
pub flags: Flags,
}Expand description
Structure to hold Argon2 inputs.
Fields§
§out: &'o mut [u8]Output array.
pwd: Option<&'p mut [u8]>Password array.
salt: Option<&'sa mut [u8]>Salt array.
secret: Option<&'se mut [u8]>Secret array.
ad: Option<&'ad mut [u8]>Associated data array.
t_cost: u32Number of passes.
m_cost: u32Amount of memory requested (KB)
lanes: u32Number of lanes.
threads: u32Maximum number of threads.
version: VersionVersion number.
flags: FlagsArray of bool options
Implementations§
Source§impl<'o, 'p, 'sa, 'se, 'ad> Context<'o, 'p, 'sa, 'se, 'ad>
impl<'o, 'p, 'sa, 'se, 'ad> Context<'o, 'p, 'sa, 'se, 'ad>
Sourcepub const SYNC_POINTS: u32 = 4u32
pub const SYNC_POINTS: u32 = 4u32
Number of synchronization points between lanes per pass.
Sourcepub const MIN_THREADS: u32 = 1u32
pub const MIN_THREADS: u32 = 1u32
Minimum number of threads.
Sourcepub const MAX_THREADS: u32 = 16_777_215u32
pub const MAX_THREADS: u32 = 16_777_215u32
Maximum number of threads.
Sourcepub const MIN_OUTLEN: u32 = 4u32
pub const MIN_OUTLEN: u32 = 4u32
Minimum digest size in bytes.
Sourcepub const MAX_OUTLEN: u32 = 4_294_967_295u32
pub const MAX_OUTLEN: u32 = 4_294_967_295u32
Maximum digest size in bytes.
Sourcepub const MIN_PWD_LENGTH: u32 = 0u32
pub const MIN_PWD_LENGTH: u32 = 0u32
Minimum password length in bytes.
Sourcepub const MAX_PWD_LENGTH: u32 = 4_294_967_295u32
pub const MAX_PWD_LENGTH: u32 = 4_294_967_295u32
Maximum password length in bytes.
Sourcepub const MIN_AD_LENGTH: u32 = 0u32
pub const MIN_AD_LENGTH: u32 = 0u32
Minimum associated data length in bytes.
Sourcepub const MAX_AD_LENGTH: u32 = 4_294_967_295u32
pub const MAX_AD_LENGTH: u32 = 4_294_967_295u32
Maximum associated data length in bytes.
Sourcepub const MIN_SALT_LENGTH: u32 = 8u32
pub const MIN_SALT_LENGTH: u32 = 8u32
Minimum salt length in bytes.
Sourcepub const MAX_SALT_LENGTH: u32 = 4_294_967_295u32
pub const MAX_SALT_LENGTH: u32 = 4_294_967_295u32
Maximum salt length in bytes.
Sourcepub const MIN_SECRET_LENGTH: u32 = 0u32
pub const MIN_SECRET_LENGTH: u32 = 0u32
Minimum key length in bytes.
Sourcepub const MAX_SECRET_LENGTH: u32 = 4_294_967_295u32
pub const MAX_SECRET_LENGTH: u32 = 4_294_967_295u32
Maximum key length in bytes.
Auto Trait Implementations§
impl<'o, 'p, 'sa, 'se, 'ad> Freeze for Context<'o, 'p, 'sa, 'se, 'ad>
impl<'o, 'p, 'sa, 'se, 'ad> RefUnwindSafe for Context<'o, 'p, 'sa, 'se, 'ad>
impl<'o, 'p, 'sa, 'se, 'ad> Send for Context<'o, 'p, 'sa, 'se, 'ad>
impl<'o, 'p, 'sa, 'se, 'ad> Sync for Context<'o, 'p, 'sa, 'se, 'ad>
impl<'o, 'p, 'sa, 'se, 'ad> Unpin for Context<'o, 'p, 'sa, 'se, 'ad>
impl<'o, 'p, 'sa, 'se, 'ad> !UnwindSafe for Context<'o, 'p, 'sa, 'se, 'ad>
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