use std::{ error::Error, ops::Range };
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct PbkdfInfo {
pub name: &'static str,
pub output_len_r: Range<usize>,
pub password_len_r: Range<usize>,
pub salt_len_r: Range<usize>,
pub cpu_cost: u64,
pub cpu_cost_r: Range<usize>,
pub memory_cost: u64,
pub memory_cost_r: Range<u64>,
pub parallelism: u64,
pub parallelism_r: Range<u64>
}
pub trait Pbkdf {
fn info(&self) -> PbkdfInfo;
fn derive(&self, buf: &mut[u8], password: &[u8], salt: &[u8], cpu_cost: u64)
-> Result<(), Box<dyn Error + 'static>>;
}
pub trait MemoryHardPbkdf: Pbkdf {
fn derive_memory_hard(&self, buf: &mut[u8], password: &[u8], salt: &[u8], cpu_cost: u64,
memory_cost: u64, parallelism: u64) -> Result<(), Box<dyn Error + 'static>>;
}