pub fn bcrypt_pbkdf_with_memory(
    passphrase: impl AsRef<[u8]>,
    salt: &[u8],
    rounds: u32,
    output: &mut [u8],
    memory: &mut [u8]
) -> Result<(), Error>
Expand description

Like bcrypt_pbkdf, but usable on “heapless” targets.

Arguments

  • passphrase - The passphrase to process.
  • salt - The salt value to use as a byte vector.
  • rounds - The number of rounds to apply.
  • output - The resulting derived key is returned in this byte vector.
  • memory - Buffer space used for internal computation.

Returns

  • Ok(()) if everything is fine.
  • Err(Error::InvalidParamLen) if passphrase.is_empty() || salt.is_empty().
  • Err(Error::InvalidRounds) if rounds == 0.
  • Err(Error::InvalidOutputLen) if output.is_empty() || output.len() > 1024.
  • Err(Error::InvalidMemoryLen) if memory.len() < (output.len() + 32 - 1) / 32 * 32, i.e. output.len() rounded up to the nearest multiple of 32.