[][src]Struct pwbox::ScryptParams

pub struct ScryptParams { /* fields omitted */ }

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.