|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectexamples.CipherBenchmark
public class CipherBenchmark
Benchmark the different encryption algorithms. The code as shipped tests the MindTerm implementations of the algorithms. By uncommenting relevant portions, and building with Java 1.4 or later, it is possible to also benchmark some of the implementations in the Java runtime.
Usage:
java -cp examples.jar examples.CipherBenchmark
Constructor Summary | |
---|---|
CipherBenchmark()
|
Method Summary | |
---|---|
static void |
bench(java.lang.String name,
java.lang.String cipher,
boolean encrypt,
int keylen,
int blocksize)
Benchmark an algorithm |
static void |
benchHash(java.lang.String name,
java.lang.String algorithm,
int blocksize)
Benchmark an hash algorithm |
static void |
benchHashSizes(java.lang.String name,
java.lang.String algorithm)
|
static void |
benchMac(java.lang.String name,
java.lang.String algorithm,
int keylen,
int blocksize)
Benchmark an hmac algorithm |
static void |
benchMac14(java.lang.String name,
java.lang.String algorithm,
int keylen,
int blocksize)
Benchmark an hmac algorithm in the java runtime |
static void |
benchMacSizes(java.lang.String name,
java.lang.String algorithm,
int keylen)
|
static void |
benchMacSizes14(java.lang.String name,
java.lang.String algorithm,
int keylen)
|
static void |
main(java.lang.String[] argv)
Run the benchmark |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CipherBenchmark()
Method Detail |
---|
public static void bench(java.lang.String name, java.lang.String cipher, boolean encrypt, int keylen, int blocksize) throws GeneralSecurityException
name
- name to print when presenting resultcipher
- formal name of algorithm to testencrypt
- true to encrypt and false to decryptkeylen
- length of keys (bytes)blocksize
- length of block to encrypt (bytes)
GeneralSecurityException
public static void benchHash(java.lang.String name, java.lang.String algorithm, int blocksize) throws GeneralSecurityException
name
- name to print when presenting resultalgorithm
- formal name of algorithm to testblocksize
- length of block to operate on
GeneralSecurityException
public static void benchHashSizes(java.lang.String name, java.lang.String algorithm) throws GeneralSecurityException
GeneralSecurityException
public static void benchMac(java.lang.String name, java.lang.String algorithm, int keylen, int blocksize) throws GeneralSecurityException
name
- name to print when presenting resultalgorithm
- formal name of algorithm to testkeylen
- length of keys (bytes)blocksize
- length of block to operate on
GeneralSecurityException
public static void benchMacSizes(java.lang.String name, java.lang.String algorithm, int keylen) throws GeneralSecurityException
GeneralSecurityException
public static void benchMac14(java.lang.String name, java.lang.String algorithm, int keylen, int blocksize) throws java.lang.Exception
name
- name to print when presenting resultalgorithm
- formal name of algorithm to testkeylen
- length of keys (bytes)blocksize
- length of block to operate on
java.lang.Exception
public static void benchMacSizes14(java.lang.String name, java.lang.String algorithm, int keylen) throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |