classpathx-crypto
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-crypto] [patch] Inlined Serpent


From: Dag Arne Osvik
Subject: Re: [Classpathx-crypto] [patch] Inlined Serpent
Date: Thu, 5 Sep 2002 22:27:05 +0200 (MEST)

On Thu, 5 Sep 2002, Raif S. Naffah wrote:

> Casey Marshall wrote:
> | (I'm CC'ing this to the crypto list, too)
> |
> | Attached is a patch to modify Serpent to use Dag Arne Osvik's inlined
> | versions of the encryption and decryption methods. The key setup is
> | still the same as before.
>
> this version:
>
> a. is _not_ thread-safe,

Just a misplaced declaration.  Move the declaration of x0,...,x4 inside
both encrypt() and decrypt().

> b. generates a 54K class file (compared to 14K for the current impl.)
> - --with Sun's javac compiler.

As expected, and not very good.  Still, code size for fully inlined
encryption & decryption for x86 is less than 6.3k bytes.  Key expansion
is 3.7k.  Java byte code is probably not as compact as x86 code, but
surely there is some overhead we could remove?

> c. runs almost 20 times slower than the current one!

This can be fixed too, as mentioned in my reply to Casey.  We just have
to work around compiler limitations.  Nothing new here..

>
> $ java -version
> java version "1.3.1"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
> Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
> $ ant speed
> ~     ...
> ~     [java] Exercising serpent...
> ~     [java] Running 1000000 iterations:
> ~     [java] Encryption: time = 70.982, speed = 220.12622 KB/s
> ~     [java] Decryption: time = 69.901, speed = 223.53043 KB/s
> ~     ...

yuck.. ;)


Regards,
Dag Arne






reply via email to

[Prev in Thread] Current Thread [Next in Thread]