mirror of
https://github.com/danog/tgseclib.git
synced 2025-01-22 05:51:20 +01:00
AES/Twofish: updates based on feedback
This commit is contained in:
parent
e74841477f
commit
abed3b4c28
@ -67,6 +67,7 @@ class AES extends Rijndael
|
|||||||
*
|
*
|
||||||
* @see \phpseclib\Crypt\Rijndael::setBlockLength()
|
* @see \phpseclib\Crypt\Rijndael::setBlockLength()
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param int $length
|
||||||
* @throws \BadMethodCallException anytime it's called
|
* @throws \BadMethodCallException anytime it's called
|
||||||
*/
|
*/
|
||||||
function setBlockLength($length)
|
function setBlockLength($length)
|
||||||
@ -92,7 +93,7 @@ class AES extends Rijndael
|
|||||||
case 256:
|
case 256:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \LengthException('Key of size ' . strlen($key) . ' not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported');
|
throw new \LengthException('Key of size ' . $length . ' not supported by this algorithm. Only keys of sizes 128, 192 or 256 supported');
|
||||||
}
|
}
|
||||||
parent::setKeyLength($length);
|
parent::setKeyLength($length);
|
||||||
}
|
}
|
||||||
|
@ -402,7 +402,7 @@ class Twofish extends Base
|
|||||||
case 256:
|
case 256:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \LengthException('Key of size ' . strlen($key) . ' not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported');
|
throw new \LengthException('Key of size ' . $length . ' not supported by this algorithm. Only keys of sizes 128, 192 or 256 supported');
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::setKeyLength($length);
|
parent::setKeyLength($length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user