Svend Olaf Mikkelsen (svolaf@inet.uni2.dk)
Thu, 24 Sep 1998 10:52:18 GMT
On Thu, 24 Sep 1998 00:30:24 -0700, Alex Alten <Alten@Home.Com> wrote:
>At 11:40 AM 9/23/98 -0400, Trei, Peter wrote:
>>The absolute *best* code I've found for generating DES key
>>schedules from scratch is Svend Mikkelsen's at
>>http://inet.uni2.dk/~svolaf/deskey1.zip It uses very clever
>>assembler. I time it at as low as 359 clock cycles per key
>>(PPro, NT4). This compares favorably with the 1900 clock
>>cycles you report.
However, due to cache issues the original libdes code by Eric Young
might be faster, depending on the application. But if someone would
implement a dictionary attack, my code can be recommended.
A copy of my earlier announcement is included below.
-- Svend OlafOn Wed, 11 Mar 1998 23:03:55 +1000 (EST), Eric Young <eay@cryptsoft.com> wrote in the RC5 Patent Awarded thread:
>On Wed, 11 Mar 1998, Svend Olaf Mikkelsen wrote:
>> For DES, key setup time can be traded for memory. My guess would be >> that key setup using 32K tables can be as fast as an encryption. > >I'll give numbers for my library, I've compiled everything using gcc under >linux, pentium pro 200. The key setup is always in C, the cipher speed is for >encrypting 8 bytes in cbc mode. These numbers are only approximate, but they >give a good approximation. > > set_key C asm cost >DES 4.830uS 2.658uS 1.709uS 14.5 bytes >3-DES 14.490uS 7.141uS 4.827uS 16.2 bytes
This is fast, and I suppose more than adequate. Having made the key setup time = encryption time statement, I however looked at what assembler and larger tables can do.
Using 4K tables in stead of 2K tables I was able to reduce the key setup time on a Pentium 120 to 3.7uS compared to 3.0uS for an assembler encryption on the same machine.
The permuted choice PC-1 is implemented with code taken from Eric Young's libdes.
The permuted choice PC-2, is implemented with 8 7-bit lookup tables. The code utilizes that the lookup indexes are the same for round 1, 5, 9, round 2, 13, round 3, 14, round 4, 15, round 6, 10, round 7, 11 and round 8, 12, 16.
The following archive was created by hippie-mail 7.98617-22 on Sat Apr 10 1999 - 01:14:01