mirror of
https://github.com/danog/phpseclib.git
synced 2024-11-30 04:39:21 +01:00
Crypt/Base: create hmac object outside of while loop
This commit is contained in:
parent
f0f7350045
commit
048635669e
@ -696,10 +696,10 @@ class Crypt_Base
|
||||
include_once 'Crypt/Hash.php';
|
||||
}
|
||||
$i = 1;
|
||||
$hmac = new Crypt_Hash();
|
||||
$hmac->setHash($hash);
|
||||
$hmac->setKey($password);
|
||||
while (strlen($key) < $dkLen) {
|
||||
$hmac = new Crypt_Hash();
|
||||
$hmac->setHash($hash);
|
||||
$hmac->setKey($password);
|
||||
$f = $u = $hmac->hash($salt . pack('N', $i++));
|
||||
for ($j = 2; $j <= $count; ++$j) {
|
||||
$u = $hmac->hash($u);
|
||||
|
Loading…
Reference in New Issue
Block a user