1996-03-27 - trouble with idea.c from cryptl99.zip

Header Data

From: Jack Mott <thecrow@iconn.net>
To: cypherpunks@toad.com
Message Hash: dc0f31746fb12531f0c8be7685ef10f95354d2c0de0c6ede47f2e880f6d64a8d
Message ID: <3158BD34.2AD8@iconn.net>
Reply To: N/A
UTC Datetime: 1996-03-27 10:08:04 UTC
Raw Date: Wed, 27 Mar 1996 18:08:04 +0800

Raw message

From: Jack Mott <thecrow@iconn.net>
Date: Wed, 27 Mar 1996 18:08:04 +0800
To: cypherpunks@toad.com
Subject: trouble with idea.c from cryptl99.zip
Message-ID: <3158BD34.2AD8@iconn.net>
MIME-Version: 1.0
Content-Type: text/plain


Hey, I downloaded the crypto lib 'cryptl99.zip' from one of the crypto 
web sites, I got IDEA.C to compile, but it doesn't seem to encrypt.  
The test code that comes with it shows the sub-key groupings, then it 
does this

X 0 1 2 3 4 5 6 7
Y 0 1 2 3 4 5 6 7
Z 0 1 2 3 4 5 6 7


It looks like X should be the plaintext, Y the ciphertext, then Z the 
plaintext again from the code, but it isn't working.  If anyone knows 
the source code I am talking about let me know what is wrong. Here is 
what the main piece looks like:

printf("\n Encrypting %d bytes (%ld blocks)...", BLOCKS*16, BLOCKS);
	fflush(stdout);
	start = clock();
	memcpy(YY, XX, 8);
	for (l = 0; l < BLOCKS; l++)
		ideaCipher(YY, YY, EK);	/* repeated encryption */
	memcpy(ZZ, YY, 8);
	for (l = 0; l < BLOCKS; l++)
		ideaCipher(ZZ, ZZ, DK);	/* repeated decryption */
	end = clock() - start;
	l = end  / (CLOCKS_PER_SEC/1000) + 1;
	i = l/1000;
	j = l%1000;
	l =  4;             // (16 * BLOCKS * (CLOCKS_PER_SEC/1000)) / 
(end/1000);
	printf("%d.%03d seconds = %ld bytes per second\n", i, j, l);

	printf("\nX %3u  %3u  %3u  %3u  %3u  %3u  %3u %3u\n",
	  XX[0], XX[1],  XX[2], XX[3], XX[4], XX[5],  XX[6], XX[7]);
	printf("\nY %3u  %3u  %3u  %3u  %3u  %3u  %3u %3u\n",
	  YY[0], YY[1],  YY[2], YY[3], YY[4], YY[5],  YY[6], YY[7]);
	printf("\nZ %3u  %3u  %3u  %3u  %3u  %3u  %3u %3u\n",    
	  ZZ[0], ZZ[1],  ZZ[2], ZZ[3], ZZ[4], ZZ[5],  ZZ[6], ZZ[7]);


from this, Y should be encrypted, but it isn't! Thanks in advance for 
any help.
-- 
 thecrow@iconn.net
"It can't rain all the time"





Thread