Enum libpasta::hashing::Algorithm [−][src]
libpasta
password hashing algorithms can be nested, which is captured
by this recursive enum.
Variants
Single(Primitive)
A single instance of a password-hashing primitive.
Nested
The password-hashing algorithm is composed of nested primitives.
Fields of Nested
outer: Primitive | The outermost layer of the algorithm is a single primitive |
inner: Box<Algorithm> | The rest of the layers |
Methods
impl Algorithm
[src]
impl Algorithm
pub fn hash(&self, password: &str) -> Output
[src]
pub fn hash(&self, password: &str) -> Output
Type-safe function to compute the hash of a password.
pub fn hash_with_salt(&self, password: &[u8], salt: &[u8]) -> Vec<u8>
[src]
pub fn hash_with_salt(&self, password: &[u8], salt: &[u8]) -> Vec<u8>
Computes the hash output for given password and salt.
pub fn verify(&self, password: &[u8], salt: &[u8], hash: &[u8]) -> bool
[src]
pub fn verify(&self, password: &[u8], salt: &[u8], hash: &[u8]) -> bool
Verifies the password, salt and hash are matching by recursively re-computing the hash and verifying the final value.
pub fn needs_migrating(&self, prim: &Primitive) -> bool
[src]
pub fn needs_migrating(&self, prim: &Primitive) -> bool
Test whether the current 'Algorithm` is sufficiently secure.
pub fn to_wrapped(&self, outer: Primitive) -> Self
[src]
pub fn to_wrapped(&self, outer: Primitive) -> Self
Copies self
into a new Algorithm
wrapped by outer
pub fn into_wrapped(self, outer: Primitive) -> Self
[src]
pub fn into_wrapped(self, outer: Primitive) -> Self
Moves self
into a new Algorithm
wrapped by outer
Trait Implementations
impl<'a> Serialize for Algorithm
[src]
impl<'a> Serialize for Algorithm
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Clone for Algorithm
[src]
impl Clone for Algorithm
fn clone(&self) -> Algorithm
[src]
fn clone(&self) -> Algorithm
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Algorithm
[src]
impl Debug for Algorithm
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Algorithm
[src]
impl PartialEq for Algorithm
fn eq(&self, other: &Algorithm) -> bool
[src]
fn eq(&self, other: &Algorithm) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Algorithm) -> bool
[src]
fn ne(&self, other: &Algorithm) -> bool
This method tests for !=
.
impl Default for Algorithm
[src]
impl Default for Algorithm