X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fscrypt%2Fclass_Scrypt.php;h=3bc5d76c216c5f43861253ccaad03bcd1845021c;hp=8f4891d06bfe5c657fc7fe942a1669d5d757b1c7;hb=de4993bdd2170972f3c004bf7473bfd2032c2dda;hpb=bb8b878603734999e7fbc6c11b0d3c6dbf550ba6 diff --git a/inc/classes/main/scrypt/class_Scrypt.php b/inc/classes/main/scrypt/class_Scrypt.php index 8f4891d0..3bc5d76c 100644 --- a/inc/classes/main/scrypt/class_Scrypt.php +++ b/inc/classes/main/scrypt/class_Scrypt.php @@ -90,7 +90,7 @@ abstract class Scrypt extends BaseFrameworkSystem $buffer_valid = true; } } - if (!$buffer_valid && is_readable('/dev/urandom')) { + if (!$buffer_valid && BaseFrameworkSystem::isReadableFile('/dev/urandom')) { $f = fopen('/dev/urandom', 'r'); $read = static::strlen($buffer); while ($read < $length) { @@ -131,15 +131,15 @@ abstract class Scrypt extends BaseFrameworkSystem public static function hashScrypt($password, $salt = false, $N = 16384, $r = 8, $p = 1) { if ($N == 0 || ($N & ($N - 1)) != 0) { - throw new \InvalidArgumentException("N must be > 0 and a power of 2"); + throw new \InvalidArgumentException('N must be > 0 and a power of 2'); } if ($N > PHP_INT_MAX / 128 / $r) { - throw new \InvalidArgumentException("Parameter N is too large"); + throw new \InvalidArgumentException('Parameter N is too large'); } if ($r > PHP_INT_MAX / 128 / $p) { - throw new \InvalidArgumentException("Parameter r is too large"); + throw new \InvalidArgumentException('Parameter r is too large'); } if ($salt === false) {