[−][src]Trait pwbox::DeriveKey
Key derivation function (KDF).
An instance of DeriveKey
implementation corresponds to a particular set of difficulty params
of a particular KDF.
Implementation notes
If you want to use a DeriveKey
implementation with an Eraser
, it should
additionally implement the following traits:
Default
(should return a KDF instance with reasonable difficulty params)Clone
Serialize
/Deserialize
fromserde
Required methods
fn salt_len(&self) -> usize
Returns byte size of salt supplied to the KDF.
fn derive_key(
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
Derives a key from the given password and salt.
Safety
When used within PwBox
, salt
is guaranteed to have the correct size.
Implementations on Foreign Types
impl DeriveKey for Box<dyn DeriveKey>
[src]
fn salt_len(&self) -> usize
[src]
fn derive_key(
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
[src]
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
Implementors
impl DeriveKey for pwbox::pure::Scrypt
[src]
fn salt_len(&self) -> usize
[src]
fn derive_key(
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
[src]
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
impl DeriveKey for pwbox::rcrypto::Scrypt
[src]
fn salt_len(&self) -> usize
[src]
fn derive_key(
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
[src]
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
impl DeriveKey for pwbox::sodium::Scrypt
[src]
fn salt_len(&self) -> usize
[src]
fn derive_key(
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>
[src]
&self,
buf: &mut [u8],
password: &[u8],
salt: &[u8]
) -> Result<(), Error>