#NEWLINE# def guess_byte( sock , message , index , guess_mac , numtrials = 5 ) : #NEWLINE# #INDENT# timings = ( [ 0 ] * 256 ) #NEWLINE# for i in range ( 256 ) : #NEWLINE# #INDENT# this_guess = setByte ( guess_mac , sock , i ) #NEWLINE# url = ( ( ( ( b'test?file=' + message ) + b'&signature=' ) + rawToHex ( this_guess ) ) + b'\n' ) #NEWLINE# start = time . perf_counter ( ) #NEWLINE# for j in range ( numtrials ) : #NEWLINE# #INDENT# sock . send ( url ) #NEWLINE# data = sock . recv ( 1024 ) #NEWLINE# #UNINDENT# stop = time . perf_counter ( ) #NEWLINE# timings [ i ] = ( stop - start ) #NEWLINE# #UNINDENT# value = timings . index ( max ( timings ) ) #NEWLINE# print ( ( ( ( 'index: ' + str ( index ) ) + ' : value: ' ) + hex ( value ) ) ) #NEWLINE# return value