parameters: (self, plaintext, output=None)
return_statement: return result
docstring: Encrypt a piece of data.
  
          Args:
            plaintext(bytes/bytearray/memoryview): The data to encrypt, of any size.
          Keyword Args:
            output(bytes/bytearray/memoryview): The location where the ciphertext
              is written to. If ``None``, the ciphertext is returned.
          Returns:
            If ``output`` is ``None``, the ciphertext is returned as ``bytes``.
            Otherwise, ``None``.
docstring_summary: Encrypt a piece of data.
docstring_tokens: Encrypt a piece of data .
function: def encrypt(self, plaintext, output=None):
          """Encrypt a piece of data.
  
          Args:
            plaintext(bytes/bytearray/memoryview): The data to encrypt, of any size.
          Keyword Args:
            output(bytes/bytearray/memoryview): The location where the ciphertext
              is written to. If ``None``, the ciphertext is returned.
          Returns:
            If ``output`` is ``None``, the ciphertext is returned as ``bytes``.
            Otherwise, ``None``.
          """
  
          if self.encrypt not in self._next:
              raise TypeError("encrypt() method cannot be called")
  
          if self._status == _CipherStatus.PROCESSING_AUTH_DATA:
              self._pad_aad()
  
          self._next = (self.encrypt, self.digest)
  
          result = self._cipher.encrypt(plaintext, output=output)
          self._len_ct += len(plaintext)
          if output is None:
              self._authenticator.update(result)
          else:
              self._authenticator.update(output)
          return result
function_tokens: def encrypt ( self , plaintext , output = None ) : if self . encrypt not in self . _next : raise TypeError ( "encrypt() method cannot be called" ) if self . _status == _CipherStatus . PROCESSING_AUTH_DATA : self . _pad_aad ( ) self . _next = ( self . encrypt , self . digest ) result = self . _cipher . encrypt ( plaintext , output = output ) self . _len_ct += len ( plaintext ) if output is None : self . _authenticator . update ( result ) else : self . _authenticator . update ( output ) return result