Struct argon2::Argon2 [−][src]
pub struct Argon2<'key> { /* fields omitted */ }
Expand description
Argon2 context.
Holds the following Argon2 inputs:
- output array and its length,
- password and its length,
- salt and its length,
- secret and its length,
- associated data and its length,
- number of passes, amount of used memory (in KBytes, can be rounded up a bit)
- number of parallel threads that will be run.
All the parameters above affect the output hash value. Additionally, two function pointers can be provided to allocate and deallocate the memory (if NULL, memory will be allocated internally). Also, three flags indicate whether to erase password, secret as soon as they are pre-hashed (and thus not needed anymore), and the entire memory
Simplest situation: you have output array out[8]
, password is stored in
pwd[32]
, salt is stored in salt[16]
, you do not have keys nor associated
data.
You need to spend 1 GB of RAM and you run 5 passes of Argon2d with 4 parallel lanes.
You want to erase the password, but you’re OK with last pass not being erased.
Implementations
Create a new Argon2 context.
Hash a password and associated parameters into the provided output buffer.
Trait Implementations
Simple API for computing a PasswordHash
from a password and
Salt
value. Read more
Compute a PasswordHash
with the given algorithm Ident
(or None
for the recommended default), password, salt, and
parameters. Read more
Auto Trait Implementations
impl<'key> RefUnwindSafe for Argon2<'key>
impl<'key> UnwindSafe for Argon2<'key>
Blanket Implementations
Mutably borrows from an owned value. Read more
Compute this password hashing function against the provided password using the parameters from the provided password hash and see if the computed output matches. Read more
type Output = T
type Output = T
Should always be Self