[][src]Enum emerald_rs::keystore::Kdf

pub enum Kdf {
    Pbkdf2 {
        prf: Prf,
        c: u32,
    },
    Scrypt {
        n: u32,
        r: u32,
        p: u32,
    },
}

Key derivation function

Variants

Pbkdf2

PBKDF2 (not recommended, specified in (RFC 2898)[https://tools.ietf.org/html/rfc2898])

Fields of Pbkdf2

prf: Prf

Pseudo-Random Functions (HMAC-SHA-256 by default)

c: u32

Number of iterations (262144 by default)

Scrypt

Scrypt (by default, specified in (RPC 7914)[https://tools.ietf.org/html/rfc7914])

Fields of Scrypt

n: u32

Number of iterations (19201 by default)

r: u32

Block size for the underlying hash (8 by default)

p: u32

Parallelization factor (1 by default)

Methods

impl Kdf[src]

pub fn derive(&self, len: usize, kdf_salt: &[u8], passphrase: &str) -> Vec<u8>[src]

Derive fixed size key for given salt and passphrase

Trait Implementations

impl Eq for Kdf[src]

impl Copy for Kdf[src]

impl Default for Kdf[src]

impl PartialEq<Kdf> for Kdf[src]

impl From<KdfDepthLevel> for Kdf[src]

impl From<u32> for Kdf[src]

impl From<(u32, u32, u32)> for Kdf[src]

impl Clone for Kdf[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Kdf[src]

impl Debug for Kdf[src]

impl FromStr for Kdf[src]

type Err = Error

The associated error which can be returned from parsing.

impl Serialize for Kdf[src]

impl<'de> Deserialize<'de> for Kdf[src]

Auto Trait Implementations

impl Send for Kdf

impl Sync for Kdf

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

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

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

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self

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

impl<T> Erased for T

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<'a, T> TryFrom for T where
    T: FromStr

type Err = <T as FromStr>::Err

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

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