demo
Class TestSpeed

java.lang.Object
  |
  +--demo.TestSpeed

public class TestSpeed
extends Object

This class measures the execution speed of the IAIK-JCE cryptographic implementations for typical applications. This class can also be used to benchmark other JCE 1.2 compatible providers, like the default Sun provider for MD5 and SHA-1 hashes or the SunJCE provider from JCE 1.2. You should notice that the IAIK provider is significantly faster on most algorithms.

Note: This class has been adapted to work both with and without a preemptive thread scheduler. The functionality and results are the same, however, when run on a non preemptive scheduler the setup time for each test will be approximately 0.5 seconds longer. Again, this has marginal effects on the test results at most.

Note: When using HotSpot or similar virtual machines the test results may not be completely accurate, in particular the result for the smallest block size may be too low; also the scheduler type detection may be incorrect. This will not happen on ordinary JIT compilers.

The test goes over several block sizes:

md2, md5, sha, sha1, arcfour, des cbc, des ede3 cbc, idea cbc, rc2 cbc, blowfish cbc for 8, 64, 256, 1024 and 8192 bytes; rsa for 512, 1024 and 2048 bits.

The results are printed in 1000s of bytes per second processed.

Usage: java demo.TestSpeed [p=name.of.provider.class] [t=time] [hashes|ciphers|rsa|all]

The results below where obtained on an AMD K6-2 333 Mhz, 128 MB SDRAM running Windows NT 4.0 SP4 Workstation network connected with standard services active. The tests were done on IAIK JCE 2.5 release with JDK 1.1.8 and Symantec JIT, each test for 4.0 seconds.

Security provider: IAIK, version 2.5
Java VM: Sun Microsystems Inc., version 1.1.8, JIT symcjit
OS: Windows NT/x86, version 4.0

The 'numbers' are in 1000s of bytes per second processed.
type              8 bytes   64 bytes   256 bytes   1024 bytes   8192 bytes
md2               864.1k      928.7k      930.6k      931.2k      932.4k
md5              6852.1k    14851.7k    15372.3k    15528.9k    15580.1k
sha1             4522.9k     7024.1k     7152.1k     7188.9k     7189.9k
ripe md128       4084.3k     6081.4k     6227.3k     6266.4k     6279.9k
ripe md160       2889.6k     4063.9k     4138.1k     4157.8k     4165.5k
arcfour          4468.4k     7510.7k     8212.3k     8405.1k     8445.5k
des cbc          1587.4k     1817.1k     1845.6k     1854.7k     1857.2k
des ede3 cbc      702.0k      741.3k      747.5k      748.4k      748.4k
idea cbc         1958.8k     2256.4k     2307.8k     2317.9k     2319.5k
rc2 cbc          1729.5k     2000.6k     2034.7k     2044.4k     2044.9k
blowfish cbc     2029.9k     2416.0k     2467.4k     2477.1k     2478.4k
rc5/12 cbc       3425.2k     4661.6k     4852.3k     4902.4k     4913.9k
gost cbc         1111.2k     1222.2k     1234.6k     1236.9k     1237.1k
cast128 cbc      1941.2k     2388.6k     2439.2k     2450.3k     2442.2k
rsa 512 bits   0.016s
rsa 1024 bits   0.103s
rsa 2048 bits   0.727s
rsa 4096 bits   5.448s
 

Results from a PII 350, 192 MB, otherwise identical circumstances:

Security provider: IAIK, version 2.5
Java VM: Sun Microsystems Inc., version 1.1.8, JIT symcjit
OS: Windows NT/x86, version 4.0

The 'numbers' are in 1000s of bytes per second processed.
type              8 bytes   64 bytes   256 bytes   1024 bytes   8192 bytes
md2               930.7k      983.8k      986.2k      985.3k      983.6k
md5              9492.8k    19641.8k    20171.9k    20293.9k    20345.0k
sha1             6552.8k    10139.9k    10321.3k    10366.3k    10384.7k
ripe md128       5957.9k     8900.6k     9029.9k     9023.5k     9057.0k
ripe md160       4509.6k     6011.3k     6080.6k     6088.7k     6099.5k
arcfour          5648.0k     8991.6k     9811.1k    10039.5k    10087.6k
des cbc          1992.3k     2232.2k     2261.2k     2271.7k     2274.5k
des ede3 cbc      869.6k      911.2k      915.5k      917.4k      918.1k
idea cbc         2469.2k     2562.5k     2602.4k     2619.7k     2626.3k
rc2 cbc          1993.8k     2203.9k     2241.5k     2249.4k     2251.4k
blowfish cbc     2686.4k     3117.0k     3172.9k     3191.6k     3194.9k
rc5/12 cbc       4116.1k     5208.2k     5383.9k     5429.2k     5441.5k
gost cbc         1703.9k     1904.3k     1936.2k     1945.4k     1947.2k
cast128 cbc      2818.1k     3333.2k     3398.4k     3420.1k     3423.2k
rsa 512 bits   0.010s
rsa 1024 bits   0.058s
rsa 2048 bits   0.382s
rsa 4096 bits   2.724s
 

Version:
File Revision 36

Constructor Summary
TestSpeed()
           
TestSpeed(boolean rsa, boolean hashes, boolean ciphers)
           
 
Method Summary
static String format(double d, int l, int k)
          Converts the input double number to an appropriate output string format.
static void main(String[] args)
          Processes various algorithm implementations to measure the speed.
 void setProvider(Provider provider)
           
 void setProvider(String providerClassName)
           
 void startTest()
          Executes some tests for several algorithms and measures the speed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSpeed

public TestSpeed(boolean rsa,
                 boolean hashes,
                 boolean ciphers)

TestSpeed

public TestSpeed()
Method Detail

format

public static String format(double d,
                            int l,
                            int k)
Converts the input double number to an appropriate output string format.
Parameters:
d - the input double number to be printed
l - the length of the resulting number string
k - the number of places behind the decimal point
Returns:
the string representing the converted input double number

setProvider

public void setProvider(Provider provider)

setProvider

public void setProvider(String providerClassName)
                 throws Exception

startTest

public void startTest()
Executes some tests for several algorithms and measures the speed.

Each test goes over several typical block sizes and the results are printed in 1000s of bytes per second processed.


main

public static void main(String[] args)
                 throws IOException
Processes various algorithm implementations to measure the speed.

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK