logo
pub struct Argon2<'key> { /* private fields */ }
Expand description

Argon2 context.

This is the primary type of this crate’s API, and contains the following:

  • Argon2 Algorithm variant to be used
  • Argon2 Version to be used
  • Default set of Params to be used
  • (Optional) Secret key a.k.a. “pepper” to be used

Implementations

Create a new Argon2 context.

Create a new Argon2 context.

Available on crate feature alloc only.

Hash a password and associated parameters into the provided output buffer.

Hash a password and associated parameters into the provided output buffer.

This method takes an explicit memory_blocks parameter which allows the caller to provide the backing storage for the algorithm’s state:

  • Users with the alloc feature enabled can use Argon2::hash_password_into to have it allocated for them.
  • no_std users on “heapless” targets can use an array of the Block type to stack allocate this 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

Converts to this type from the input type.

Converts to this type from the input type.

Algorithm-specific parameters.

Simple API for computing a PasswordHash from a password and salt value. Read more

Compute a PasswordHash from the provided password using an explicit set of customized algorithm parameters as opposed to the defaults. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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

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.