Cryptcat compiled on a big-endian architecture like
Sparc will not talk with cryptcat compiled on a
little-endian architecture like Pentium.
The problem is with the macros for extracting specific
bytes from a 4 byte word. The b0(x) macro is supposed
to extract the least significant byte, the b1(x) macro
the next least significant, the b2(x) macro the next
least significant byte and the b3(x) macro the most
These macros are implemented in terms of the _b(x,n)
macro, which extracts the n%4 th byte from x.
Unfortunately, the macros as defined will work
correctly on little-endian machines, but not big-endian
I have fixed this by defining the _b() and bx() macros
as inline functions which do the right thing with
either endianness. Unfortunately, I had to rename the
bx() macros to bxf() functions because the code uses
regular variables with the same name as the macros(!).
The solution is probably not bulletproof as it assumes
4 byte ints, but my impression is that the whole
program will fall apart if sizeof(int) != sizeof(long)
!= sizeof(char*) != 4 anyway.
After applying this fix, you can cryptcat between
Solaris/Sparc and Linux etc/Intel.
I believe I have a context diff which can be applied to
twofish2.cc and twofish2.h to correct the problem.