def encryptAndHMAC( self, crypter, hmacKey ):
        """
        Encrypt and authenticate this protocol message.

        This protocol message is encrypted using `crypter' and authenticated
        using `hmacKey'.  Finally, the encrypted message prepended by a
        HMAC-SHA256-128 is returned and ready to be sent over the wire.
        """

        encrypted = crypter.encrypt(pack.htons(self.totalLen) +
                                    pack.htons(self.payloadLen) +
                                    chr(self.flags) + self.payload +
                                    (self.payloadLen - self.totalLen) * '\0')

        hmac = mycrypto.HMAC_SHA256_128(hmacKey, encrypted)

        return hmac + encrypted
dataset/ETHPy150Open isislovecruft/obfsproxy/obfsproxy/transports/scramblesuit/message.py/ProtocolMessage.encryptAndHMAC/swapped operands of `-`