code: def new_cipher(self, key, iv, digest=None):
          
          if type(key) is str:
              key = key.encode('ascii')
          if self.is_aead and digest is not None:
              # With AEAD, the mode needs the digest during decryption.
              return Cipher(
                  self.cipher(key),
                  self.mode(iv, digest, len(digest)),
                  default_backend(),
              )
          else:
              return Cipher(
                  self.cipher(key),
                  self.mode(iv),
                  default_backend(),
              )
docs: @param key:    the secret key, a byte string
          @param iv:     the initialization vector, a byte string. Used as the
                         initial nonce in counter mode
          @param digest: also known as tag or icv. A byte string containing the
                         digest of the encrypted data. Only use this during
                         decryption!
  
          @return:    an initialized cipher object for this algo