1 | initial version |
The output of the sdes.encrypt
function is a bit strange. The elements of the output can be coerced to the reals but not to integers. So, something like this should work. Replace your return with
return [(ZZ(RR(a)) + ZZ(RR(b))) % 2 for a,b in zip(block1, block2)]