def __init__(self, name, _alg=None):
        """Initialize the cipher by name."""

        if _alg:
            self.alg = _alg
            self.gcm = True
            return
        else:

            self.alg = _C.EVP_get_cipherbyname(name.encode("utf8"))
            self.gcm = False
            if self.alg == _FFI.NULL:
                raise Exception("Unknown cipher: %s" % name )

        if "gcm" in name.lower():
            self.gcm = True
        
        if "ccm" in name.lower():
            raise Exception("CCM mode not supported")
dataset/ETHPy150Open gdanezis/petlib/petlib/cipher.py/Cipher.__init__/original