Enum libpasta::hashing::Algorithm
[−]
[src]
pub enum Algorithm { Single(Primitive), Nested { outer: Primitive, inner: Box<Algorithm>, }, }
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]
fn hash(&self, password: Cleartext) -> Output
Type-safe function to compute the hash of a password.
fn hash_with_salt(&self, password: &[u8], salt: &[u8]) -> Vec<u8>
Computes the hash output for given password and salt.
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.
fn needs_migrating(&self) -> bool
Test whether the current 'Algorithm` is sufficiently secure.
fn to_wrapped(&self, outer: Primitive) -> Self
Copies self
into a new Algorithm
wrapped by outer
fn into_wrapped(self, outer: Primitive) -> Self
Moves self
into a new Algorithm
wrapped by outer
Trait Implementations
impl<'a> Serialize for Algorithm
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Clone for Algorithm
[src]
fn clone(&self) -> Algorithm
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Algorithm
[src]
impl PartialEq for Algorithm
[src]
fn eq(&self, __arg_0: &Algorithm) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Algorithm) -> bool
This method tests for !=
.