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: Raif S. Naffah
Subject: Re: [Classpathx-crypto] [patch] Inlined Serpent
Date: Thu, 05 Sep 2002 21:20:03 +1000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

hello Casey and Dag,

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,
b. generates a 54K class file (compared to 14K for the current impl.)
- --with Sun's javac compiler.
c. runs almost 20 times slower than the current one!

$ 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
~     ...

i'm not saying though that it's devoid of any benefits.

| ...
| The good news is that with other VMs this implementation is MUCH faster.
| Kaffe (version 1.0.6, JIT v3) can get ~5.5 MB/s, and a native version
| produced by GCJ runs at ~8 MB/s (second fastest for encryption, behind
| Rijndael, and neck-and-neck with Anubis for decryption).

i see some advantages in keeping the current implementation _and_ adding
the new in-lined one as an alternative; say SerpentInLined? (naming
suggestions are welcome)


i'll start a new thread about discussing this alternative in general;
i.e. how can we [re-]write the Factory methods to provide the _optimal_
implementation.

i'll also start another thread about collecting and publishing
performance figures which, ultimately may allow us to tailor the
heuristic for selecting one implementation among many, depending on the
host environment.


| If we can come up with a way to make this inlined version more
| digestible for certain JITs, I think this would be a good implementation
| for future releases.

pointers to finding out more about JIT nuts and bolts, anybody?


cheers;
rsn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Que du magnifique

iD8DBQE9dz3Y+e1AKnsTRiERA2VCAJ43zbmS7Ys5/jFHGYpxw1FvpEkR3ACeILtG
3OnHVjsNW157F8Rbw8+Feww=
=UiS0
-----END PGP SIGNATURE-----





reply via email to

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