code: def encrypt(self, k, a, m):
          
          hkey = k[:_inbytes(self.keysize)]
          ekey = k[_inbytes(self.keysize):]
  
          # encrypt
          iv = _randombits(self.blocksize)
          cipher = Cipher(algorithms.AES(ekey), modes.CBC(iv),
                          backend=self.backend)
          encryptor = cipher.encryptor()
          padder = PKCS7(self.blocksize).padder()
          padded_data = padder.update(m) + padder.finalize()
          e = encryptor.update(padded_data) + encryptor.finalize()
  
          # mac
          t = self._mac(hkey, a, iv, e)
  
          return (iv, e, t)
docs: Encrypt according to the selected encryption and hashing
          functions.
  
          :param k: Encryption key (optional)
          :param a: Additional Authentication Data
          :param m: Plaintext
  
          Returns a dictionary with the computed data.