Function scrypt::scrypt

source ·
pub fn scrypt(
    password: &[u8],
    salt: &[u8],
    params: &Params,
    output: &mut [u8]
) -> Result<(), InvalidOutputLen>
Expand description

The scrypt key derivation function.

Arguments

  • password - The password to process as a byte vector
  • salt - The salt value to use as a byte vector
  • params - The ScryptParams to use
  • output - The resulting derived key is returned in this byte vector. WARNING: Make sure to compare this value in constant time!

Return

Ok(()) if calculation is successful and Err(InvalidOutputLen) if output does not satisfy the following condition: output.len() > 0 && output.len() <= (2^32 - 1) * 32.