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.

Get default configured Params.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Algorithm-specific parameters.

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.