Hi,
I propose a little but usefull patch to twofish.c.
The patch allow gcc to compile twofish.c with -O2 without having to
wait forever and a day. As a side effect, this patch also reduce the
text size by more than 100 KB (!).
It's rather simple : I moved all CALC_SB() and CALC_SB256() macro
calls to a loop and put all hex arguments into a static table.
Here's the result with gcc 2.7.2.3 on my 486/100 :
1) un-patched, compiled with -DTEST but without any optimization level :
compilation time : 52.7s
text size : 137.5 KB
execution time : 22.9s
2) patched, compiled with -O2 -DTEST :
compilation time : 58.5s
text size : 33.0 KB
execution time : 15.7s
--
RĂ©mi <rguyom@mail.dotcom.fr> | Don't waste your computer's time :
PGP-encrypt anything important: | http://www.distributed.net/
www.gnupg.org - KeyID:0x85BD8B1B | http://www.distributed.net/cores/
I propose a little but usefull patch to twofish.c.
The patch allow gcc to compile twofish.c with -O2 without having to
wait forever and a day. As a side effect, this patch also reduce the
text size by more than 100 KB (!).
It's rather simple : I moved all CALC_SB() and CALC_SB256() macro
calls to a loop and put all hex arguments into a static table.
Here's the result with gcc 2.7.2.3 on my 486/100 :
1) un-patched, compiled with -DTEST but without any optimization level :
compilation time : 52.7s
text size : 137.5 KB
execution time : 22.9s
2) patched, compiled with -O2 -DTEST :
compilation time : 58.5s
text size : 33.0 KB
execution time : 15.7s
--
RĂ©mi <rguyom@mail.dotcom.fr> | Don't waste your computer's time :
PGP-encrypt anything important: | http://www.distributed.net/
www.gnupg.org - KeyID:0x85BD8B1B | http://www.distributed.net/cores/