[rc5] Speed freeks with Cyrix, AMD, PPro or RISC machines ?

Remi Guyomarch rguyom at mail.dotcom.fr
Sun Jul 13 00:39:32 EDT 1997

Ronald Van Iwaarden wrote:
> I compiled the source under OS/2 and, without optimization and with debugging
> switch, I get:
> [E:\download\extract]client-6x86-2.exe -m
> RC5-56 client modified from the genx sources by
> Rémi Guyomarch <rguyom at mail.dotcom.fr> - 97/07/10
> rc5-56-client (rg) : Testing crypt routines
> rc5-56-client (rg) : Crypt routine isn't working !
> rc5-56-client (rg) : (detecting a good key)
> rc5-56-client (rg) : key = 0x1411B3 0x5A9A98DA
> If I compile without debugging and with optimization, I get a core dump.

Oops ! This is probably because I've told gcc to pass parameters by
registers, and my ASM assume this. So if your compiler doesn't
understand the directive, or does it a different way, you will have to
disable register parameter passing. Here's how :

Replace this code in all client-keyexp-*-2.s files :

	movl	%eax, %ebx	/* ebx = l0 */
	#movl	%edx, %edx	/* edx = l1 */
	movl	%ecx, %esi	/* esi = l2 */
	movl	20(%esp), %edi	/* edi = l3 */

with :

	movl	20(%esp), %ebx	/* ebx = l0 */
	movl	24(%esp), %edx	/* edx = l1 */
	movl	28(%esp), %esi	/* esi = l2 */
	movl	32(%esp), %edi	/* edi = l3 */

And replace this code in client-2.h :

	extern int RC5_KEY_CHECK_INNER (RC5_WORD L_0, RC5_WORD L_1,
					RC5_WORD L_2, RC5_WORD L_3)
	#if defined(__GNUC__) && defined(i386)
	    __attribute__ ((regparm (3)))

with :

	extern int RC5_KEY_CHECK_INNER (RC5_WORD L_0, RC5_WORD L_1,
					RC5_WORD L_2, RC5_WORD L_3);

It should work, at the expense of some kkeys/s.


To unsubscribe, send email to majordomo at llamas.net with 'unsubscribe rc5' in the body.

More information about the rc5 mailing list