In the code below concatenation is the bottleneck. As you can see i've tried some sophisticated methods to speed this up, but its bloody slow anyway. I would like to know if there is anything i can do to make it faste.
BTW both plain and secret are data read from binary file and they are quite big (around 1mb)
x = b''
if len(plain) < len(secret*8):
return False
i = 0
for secByte in secret:
for j in range(8):
z = setBit(plain[i],0,getBit(secByte,j))
#x += bytes([z])
x = x.join([b"", bytes([z])])
#x = array.array("B",(int(z) for z in x.join([b"", bytes([z])]))).tostring()
i = i+1