NODE bb600639Magic money not working bigendian
qwerty-remailer@netcom.comThu, 10 Feb 94 16:20:25 PST
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.
NODE 5eeddc51Magic money not working bigendian
m5@vail.tivoli.com (Mike McNally)Fri, 11 Feb 94 05:50:31 PST
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" |
NODE 4fca3521Magic money not working bigendian
solovay@math.berkeley.edu (Robert M. Solovay)Thu, 10 Feb 94 17:10:25 PST
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.]
NODE 36769259Magic money not working bigendian
hughes@ah.com (Eric Hughes)Thu, 10 Feb 94 18:00:25 PST
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