[−][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]
fn clone(&self) -> ScryptParams[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for ScryptParams[src]
impl Debug for ScryptParams[src]
impl Default for ScryptParams[src]
fn default() -> Self[src]
Returns the "interactive" scrypt parameters as defined in libsodium.
n = 2^14, r = 8, p = 1.
impl<'de> Deserialize<'de> for ScryptParams[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
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,
pub fn borrow_mut(&mut self) -> &mut T[src]
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,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,