def decryptMessage(self, ciphertext, header, ad = None):
if ad == None:<EOL><INDENT>ad = self.__ad<EOL><DEDENT>plaintext = self.__decryptSavedMessage(ciphertext, header, ad)<EOL>if plaintext:<EOL><INDENT>return plaintext<EOL><DEDENT>if self.triggersStep(header.dh_pub):<EOL><INDENT>self.__saveMessageKeys(header.pn)<EOL>self.step(header.dh_pub)<EOL><DEDENT>self.__saveMessageKeys(header.n)<EOL>return self.__decrypt(<EOL>ciphertext,<EOL>self.__skr.nextDecryptionKey(),<EOL>header,<EOL>ad<EOL>)<EOL>
Decrypt a message using this double ratchet session.

:param ciphertext: A bytes-like object encoding the message to decrypt.
:param header: An instance of the Header class. This should have been sent
    together with the ciphertext.
:param ad: A bytes-like object encoding the associated data to use for message
    authentication. Pass None to use the associated data set during construction.
:returns: The plaintext.

:raises AuthenticationFailedException: If checking the authentication for this
    message failed.
:raises NotInitializedException: If this double ratchet session is not yet
    initialized with a key pair, thus not prepared to decrypt an incoming message.
:raises TooManySavedMessageKeysException: If more than message_key_store_max have
    to be stored to decrypt this message.