Magic money not working bigendian
I have not been able to get Magic Money to work right in big-endian mode using pgptl10c.zip and mgmny10d.zip. It does not work with either -DHIGHFIRST or -DHIGHFIRST plus -DHIGH_KLUDGE. The key generation seems to go OK, but then when I "mint" a coins.dat file with 6 coins in the server and try reading it in the client, all coins after the first are said to have bad signature. I have tried it with both 512 and 1024 bit keys and both fail. The previous version of magicmny.zip worked OK.
Is there a simple way to find out if ones computer is big-endian or not? [Like a simple C program that one can compile and run to settle the question.]
Try this: -------------------------------------------- #include <stdio.h> main() { long t = 1 ; char *cp = (char *) & t ; printf( "%s-endian\n", ( *cp != 0 ) ? "little" : "big" ) ; } -------------------------------------------- On a little-endian machine, the least significant byte is stored first; on big-endian, the most significant. The address of a long points to the first byte, i.e. the byte with the lowest address. The above program tests to see if the first byte is non-zero, which is true iff the length of a char is less than the length of a long (usually true) and if the least significant byte is first, i.e. little-endian. Further responses should go only to my mailbox. Eric
Robert M. Solovay writes:
Is there a simple way to find out if ones computer is big-endian or not? [Like a simple C program that one can compile and run to settle the question.]
Perhaps I can redeem myself by doing the cypherpunk thing and writing code: int isBigEndian() { int test = 0; char *testP = (char *) &test; *testP = 0xff; return !(test & 0xff); } -- | GOOD TIME FOR MOVIE - GOING ||| Mike McNally <m5@tivoli.com> | | TAKE TWA TO CAIRO. ||| Tivoli Systems, Austin, TX: | | (actual fortune cookie) ||| "Like A Little Bit of Semi-Heaven" |
participants (4)
-
hughes@ah.com -
m5@vail.tivoli.com -
qwerty-remailer@netcom.com -
solovay@math.berkeley.edu