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§
Sourcefn create(algorithm: &str, opts: Option<OptionView<'_>>) -> PluginResult<Self>
fn create(algorithm: &str, opts: Option<OptionView<'_>>) -> PluginResult<Self>
Construct a new KDF instance for the named algorithm.
Sourcefn set_salt(&mut self, salt: &[u8]) -> PluginResult<()>
fn set_salt(&mut self, salt: &[u8]) -> PluginResult<()>
Set the salt.
Sourcefn set_iterations(&mut self, iterations: u32) -> PluginResult<()>
fn set_iterations(&mut self, iterations: u32) -> PluginResult<()>
Set the iteration count.
Sourcefn set_memory_cost(&mut self, bytes: u64) -> PluginResult<()>
fn set_memory_cost(&mut self, bytes: u64) -> PluginResult<()>
Set the memory cost in bytes.
Sourcefn set_parallelism(&mut self, lanes: u32) -> PluginResult<()>
fn set_parallelism(&mut self, lanes: u32) -> PluginResult<()>
Set the parallelism (number of lanes).
Sourcefn set_hash(&mut self, hash_name: &str) -> PluginResult<()>
fn set_hash(&mut self, hash_name: &str) -> PluginResult<()>
Set the hash algorithm name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".