#NEWLINE# def hash( self , sa , da , priority , msduData ) : #NEWLINE# #INDENT# ' The TKIP MIC appends sa, da and priority to msduData\n            and uses the result in the Michael keyed hash\n            to create an 8 octet MIC value\n        ' #NEWLINE# assert ( 0 <= priority <= 15 ) , 'Priority must be 4 bit value' #NEWLINE# assert ( ( len ( sa ) == 6 ) and ( len ( da ) == 6 ) ) , 'Addresses must be 6 octets' #NEWLINE# if ( priority . version == 'D3' ) : #NEWLINE# #INDENT# micData = ( ( ( ( da + sa ) + chr ( priority ) ) + ( 3 * chr ( 0 ) ) ) + msduData ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . version == 'D2' ) : #NEWLINE# #INDENT# micData = ( ( da + sa ) + msduData ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise 'bad version' #NEWLINE# #UNINDENT# #UNINDENT# return Michael . hash ( self , micData )