When calculating bias for each key, in some combination there are zeros in hits. It causes bias=0.5. In the failing situations, obtained key bits always stuck at some values like f or ff
`bias = [ fabs(num_hits - float(NUM_P_C_PAIRS/2)) / float(NUM_P_C_PAIRS) for num_hits in hits ]`
Code line
You can add hits = [i for i in hits if i != 0] for removing zeros in hits.
When calculating bias for each key, in some combination there are zeros in hits. It causes bias=0.5. In the failing situations, obtained key bits always stuck at some values like f or ff
Code line
You can add
hits = [i for i in hits if i != 0]for removing zeros in hits.