From 448be87e83ba78df812e23b59e6fdaa75b2cf164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans-J=C3=BCrgen=20Petrich?= Date: Sun, 19 May 2013 23:35:06 +0700 Subject: [PATCH] Twofish: bugfix in setPasswort() fixed bug in setPasswort()... (occurred only in Twofish.php) --- phpseclib/Crypt/Twofish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;