Trait libpasta::primitives::PrimitiveImpl [] [src]

pub trait PrimitiveImpl: Debug + Send + Sync {
    fn compute(&self, password: &[u8], salt: &[u8]) -> Vec<u8>;
    fn params_as_vec(&self) -> Vec<(&'static str, String)>;
    fn hash_id(&self) -> Hashes;

    fn verify(&self, password: &[u8], salt: &[u8], hash: &[u8]) -> bool { ... }
}

Trait defining the functionality of a hashing primitive.

Required Methods

Compute the output of the primitive with input password and salt.

Output the parameters of the primitive as a list of tuples.

Return algorithm type as a MCF-compatible hash identifier.

Provided Methods

Verify the password and salt against the hash.

In many cases, this just checks whether compute(password, salt) == hash.

Trait Implementations

impl PartialEq<PrimitiveImpl> for PrimitiveImpl
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd<PrimitiveImpl> for PrimitiveImpl
[src]

Compare two primitive parameterisations by first checking for equality of the hash identifiers, and then attempting to compare the parameters numerically.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Implementors