pub struct Params { /* private fields */ }Expand description
The Scrypt parameter values.
Implementations§
Source§impl Params
impl Params
Sourcepub const RECOMMENDED_LOG_N: u8 = 17
pub const RECOMMENDED_LOG_N: u8 = 17
Recommended log₂ of the Scrypt parameter N: CPU/memory cost.
Sourcepub const RECOMMENDED_R: u32 = 8
pub const RECOMMENDED_R: u32 = 8
Recommended Scrypt parameter r: block size.
Sourcepub const RECOMMENDED_P: u32 = 1
pub const RECOMMENDED_P: u32 = 1
Recommended Scrypt parameter p: parallelism.
Sourcepub const RECOMMENDED_LEN: usize = 32
pub const RECOMMENDED_LEN: usize = 32
Recommended Scrypt parameter Key length.
Sourcepub fn new(
log_n: u8,
r: u32,
p: u32,
len: usize,
) -> Result<Params, InvalidParams>
pub fn new( log_n: u8, r: u32, p: u32, len: usize, ) -> Result<Params, InvalidParams>
Create a new instance of Params.
§Arguments
log_n- The log₂ of the Scrypt parameterNr- The Scrypt parameterrp- The Scrypt parameterplen- The Scrypt parameterKey length
§Conditions
log_nmust be less than64rmust be greater than0and less than or equal to4294967295pmust be greater than0and less than4294967295lenmust be greater than9and less than or equal to64
Sourcepub fn recommended() -> Params
pub fn recommended() -> Params
Recommended values sufficient for most use-cases
log_n = 15(n = 32768)r = 8p = 1
Sourcepub fn log_n(&self) -> u8
pub fn log_n(&self) -> u8
log₂ of the Scrypt parameter N, the work factor.
Memory and CPU usage scale linearly with N.
Trait Implementations§
impl Copy 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 UnsafeUnpin 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