Skip to main content

scrypt

Function scrypt 

Source
pub fn scrypt(
    password: &[u8],
    salt: &[u8],
    n: i64,
    r: i64,
    p: i64,
    key_length: i64,
) -> Result<Vec<u8>, Failure>
Expand description

scrypt($password, $salt, $N, $r, $p, $keyLength, true): the raw derived key (PHP’s default output is its hex, bin2hex() of this).

§Errors

As PHP scrypt() fails: the Error its arguments raise ($N not a power of 2 greater than 1, $r or $p below 1 or above 2^32 - 1, $keyLength below 16 or above (2^32 - 1) * 32), the warning and false of crypto_scrypt’s checks ($r * $p of 2^30 or more, or memory beyond the address space), and false when memory runs out.