diff --git a/php/aes_fast.php b/php/aes_fast.php index 3972a2a..decbe17 100644 --- a/php/aes_fast.php +++ b/php/aes_fast.php @@ -429,7 +429,7 @@ private static function main($state,$expandedKey,$nbrRounds){ private static function invMain($state, $expandedKey, $nbrRounds){ $state = self::addRoundKey($state, self::createRoundKey($expandedKey,16*$nbrRounds)); for ($i = $nbrRounds-1; $i > 0; $i--) - $state = self::invRound($state, self::createRoundKey($expandedKey,16*i)); + $state = self::invRound($state, self::createRoundKey($expandedKey,16*$i)); $state = self::shiftRows($state,true); $state = self::subBytes($state,true); $state = self::addRoundKey($state, self::createRoundKey($expandedKey,0)); @@ -703,4 +703,4 @@ public static function decrypt($cipherIn,$originalsize,$mode,$key,$size,$iv) */ } -?> \ No newline at end of file +?> diff --git a/php/aes_small.php b/php/aes_small.php index b0c2ef3..bd9e38e 100644 --- a/php/aes_small.php +++ b/php/aes_small.php @@ -323,7 +323,7 @@ private static function main($state,$expandedKey,$nbrRounds){ private static function invMain($state, $expandedKey, $nbrRounds){ $state = self::addRoundKey($state, self::createRoundKey($expandedKey,16*$nbrRounds)); for ($i = $nbrRounds-1; $i > 0; $i--) - $state = self::invRound($state, self::createRoundKey($expandedKey,16*i)); + $state = self::invRound($state, self::createRoundKey($expandedKey,16*$i)); $state = self::shiftRows($state,true); $state = self::subBytes($state,true); $state = self::addRoundKey($state, self::createRoundKey($expandedKey,0)); @@ -597,4 +597,4 @@ public static function decrypt($cipherIn,$originalsize,$mode,$key,$size,$iv) */ } -?> \ No newline at end of file +?>