| 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)]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.