static public getEncryptionMode ( string $mode ) : integer | ||
$mode | string | |
return | integer |
static function getEncryptionMode($mode)
{
switch ($mode) {
case 'CBC':
return BlockCipher::MODE_CBC;
case 'ECB':
return BlockCipher::MODE_ECB;
case 'CFB':
return BlockCipher::MODE_CFB;
case 'OFB':
return BlockCipher::MODE_OFB;
case 'CTR':
return BlockCipher::MODE_CTR;
}
throw new \UnexpectedValueException('Unsupported block cipher mode of operation');
}