pub trait KeyDerivation: Send + Sync {
// Required methods
fn derive_key(
&self,
password: &[u8],
salt: &[u8],
key_length: usize,
) -> CryptoResult<Vec<u8>>;
fn generate_salt(&self, length: usize) -> Vec<u8> ⓘ;
fn algorithm(&self) -> &'static str;
}Expand description
Trait for key derivation functions.
Required Methods§
Sourcefn derive_key(
&self,
password: &[u8],
salt: &[u8],
key_length: usize,
) -> CryptoResult<Vec<u8>>
fn derive_key( &self, password: &[u8], salt: &[u8], key_length: usize, ) -> CryptoResult<Vec<u8>>
Derive a key from a password and salt.