pub struct Params { /* private fields */ }Expand description
yescrypt algorithm parameters.
Params::default provides the recommended parameters.
These are various algorithm settings which can control e.g. the amount of resource utilization.
Implementations§
Source§impl Params
impl Params
Sourcepub fn new(mode: Mode, n: u64, r: u32, p: u32) -> Result<Params>
pub fn new(mode: Mode, n: u64, r: u32, p: u32) -> Result<Params>
Initialize params.
Accepts the following arguments:
mode: most users will wantMode::default. See theModetype for more info.n: CPU/memory cost. SeeParams::nfor more info.r: resource usage. SeeParams::rfor more info.p: parallelization. SeeParams::pfor more info.
Sourcepub fn new_with_all_params(
mode: Mode,
n: u64,
r: u32,
p: u32,
t: u32,
g: u32,
) -> Result<Params>
pub fn new_with_all_params( mode: Mode, n: u64, r: u32, p: u32, t: u32, g: u32, ) -> Result<Params>
Initialize params including additional yescrypt-specific settings.
Accepts all the same arguments as Params::new with the following additional arguments:
t: increase computation time while keeping peak memory usage the same.0is optimal.g: number of cost upgrades performed on the hash so far.0is the only allowed value.
Sourcepub const fn n(&self) -> u64
pub const fn n(&self) -> u64
N: CPU/memory cost (like scrypt).
Memory and CPU usage scale linearly with N.
Trait Implementations§
impl Copy for Params
impl Eq for Params
impl StructuralPartialEq for Params
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more