[−][src]Struct pwbox::ScryptParams
Scrypt
key derivation function parameterized as per the original paper.
Serialization
The function is serialized as three fields: n
, r
and p
. See the Scrypt paper
for more details on what they mean.
use serde_json::json; let scrypt = Scrypt::default(); assert_eq!( serde_json::to_value(scrypt).unwrap(), json!({ "n": 16384, "r": 8, "p": 1 }) );
Implementations
impl ScryptParams
[src][−]
pub const fn light() -> Self
[src][−]
Returns "light" scrypt
parameters as used in Ethereum keystore implementations.
n = 2^12, r = 8, p = 6.
pub const fn custom(log_n: u8, p: u32) -> Self
[src][−]
Creates custom parameters for scrypt KDF.
The r
parameter is always set to 8 as per libsodium conversion
from opslimit
/ memlimit
and per Ethereum keystore implementations.
Trait Implementations
impl Clone for ScryptParams
[src][+]
impl Copy for ScryptParams
[src]
impl Debug for ScryptParams
[src][+]
impl Default for ScryptParams
[src][+]
impl<'de> Deserialize<'de> for ScryptParams
[src][+]
impl Serialize for ScryptParams
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for ScryptParams
impl Send for ScryptParams
impl Sync for ScryptParams
impl Unpin for ScryptParams
impl UnwindSafe for ScryptParams
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,