#NEWLINE# def verify( self , seqid , data , mac ) : #NEWLINE# #INDENT# '\n        Verify an incoming MAC using the incoming MAC values.\n\n        @type seqid: L{int}\n        @param seqid: The sequence ID of the incoming packet.\n\n        @type data: L{bytes}\n        @param data: The packet data to verify.\n\n        @type mac: L{bytes}\n        @param mac: The MAC sent with the packet.\n\n        @rtype: C{bool}\n        @return: C{True} if the MAC is valid.\n        ' #NEWLINE# if ( not self . inMAC [ 0 ] ) : #NEWLINE# #INDENT# return ( mac == b'' ) #NEWLINE# #UNINDENT# data = ( struct . pack ( '>L' , seqid ) + data ) #NEWLINE# outer = hmac . HMAC ( self . inMAC . key , data , self . inMAC [ 0 ] ) . digest ( ) #NEWLINE# return ( mac == outer )