Function nacl::scrypt [−][src]
pub fn scrypt(
passwd: &[u8],
salt: &[u8],
logN: u8,
r: usize,
p: usize,
dk_len: usize,
progress_cb: &dyn Fn(u32)
) -> Result<Vec<u8>, Error>
Expand description
crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, p, buflen) and write the result into buf. The parameters r, p, and buflen must satisfy r * p < 2^30 and buflen <= (2^32 - 1) * 32. The parameter N must be a power of 2. Return 0 on success; or -1 on error.
This rust implementation notes:
- we asks for
logN
to enforce N being a power of 2. - we use standard memory allocation. When run in operating system, allocation calls return ok even on infinite amount, pushing error/panic later into the process that populates all of this area with random bytes.