diff --git a/phpseclib/Crypt/Twofish.php b/phpseclib/Crypt/Twofish.php index fb69b512..c6153a9a 100644 --- a/phpseclib/Crypt/Twofish.php +++ b/phpseclib/Crypt/Twofish.php @@ -793,7 +793,7 @@ class Crypt_Twofish { $hmac = new Crypt_Hash(); $hmac->setHash($hash); $hmac->setKey($password); - $f = $u = $hmac->hash($salt . pack('N', ++$i)); + $f = $u = $hmac->hash($salt . pack('N', $i++)); for ($j = 2; $j <= $count; ++$j) { $u = $hmac->hash($u); $f^= $u;