Skip to main content

KdfPlugin

Trait KdfPlugin 

Source
pub trait KdfPlugin: Sized {
    // Required methods
    fn create(
        algorithm: &str,
        opts: Option<OptionView<'_>>,
    ) -> PluginResult<Self>;
    fn set_salt(&mut self, salt: &[u8]) -> PluginResult<()>;
    fn set_iterations(&mut self, iterations: u32) -> PluginResult<()>;
    fn set_memory_cost(&mut self, bytes: u64) -> PluginResult<()>;
    fn set_parallelism(&mut self, lanes: u32) -> PluginResult<()>;
    fn set_hash(&mut self, hash_name: &str) -> PluginResult<()>;
    fn derive(&mut self, input: &[u8], out: &mut [u8]) -> PluginResult<()>;
}
Expand description

Trait implemented by KDF plugins.

Required Methods§

Source

fn create(algorithm: &str, opts: Option<OptionView<'_>>) -> PluginResult<Self>

Construct a new KDF instance for the named algorithm.

Source

fn set_salt(&mut self, salt: &[u8]) -> PluginResult<()>

Set the salt.

Source

fn set_iterations(&mut self, iterations: u32) -> PluginResult<()>

Set the iteration count.

Source

fn set_memory_cost(&mut self, bytes: u64) -> PluginResult<()>

Set the memory cost in bytes.

Source

fn set_parallelism(&mut self, lanes: u32) -> PluginResult<()>

Set the parallelism (number of lanes).

Source

fn set_hash(&mut self, hash_name: &str) -> PluginResult<()>

Set the hash algorithm name.

Source

fn derive(&mut self, input: &[u8], out: &mut [u8]) -> PluginResult<()>

Derive out.len() bytes of key material from input.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§