phpseclib\Crypt\Common\PKCS1::getEncryptionMode PHP Method

getEncryptionMode() static public method

Returns the mode constant corresponding to the mode string
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');
    }