examples
public class CipherBenchmark extends java.lang.Object
Constructor and Description |
---|
CipherBenchmark() |
Modifier and Type | Method and Description |
---|---|
static void |
benchCipher(java.lang.String name,
java.lang.String cipher,
int keylen,
int blocksize,
int ivlength)
Benchmark an algorithm, both encryption and decryption
|
static void |
benchCipher(java.lang.String name,
java.lang.String cipher,
java.lang.String provider,
boolean encrypt,
int keylen,
int blocksize,
int ivlength)
Benchmark an algorithm
|
static void |
benchHash(java.lang.String name,
java.lang.String algorithm) |
static void |
benchHash(java.lang.String name,
java.lang.String algorithm,
java.lang.String provider,
int blocksize)
Benchmark an hash algorithm
|
static void |
benchMac(java.lang.String name,
java.lang.String algorithm,
int keylen) |
static void |
benchMac(java.lang.String name,
java.lang.String algorithm,
java.lang.String provider,
int keylen,
int blocksize)
Benchmark an hmac algorithm
|
static void |
main(java.lang.String[] argv)
Run the benchmark
|
public static void benchCipher(java.lang.String name, java.lang.String cipher, int keylen, int blocksize, int ivlength)
name
- name to print when presenting resultcipher
- formal name of algorithm to testkeylen
- length of keys (bytes)blocksize
- length of block to encrypt (bytes)ivlength
- length of initialization vector (bytes)public static void benchCipher(java.lang.String name, java.lang.String cipher, java.lang.String provider, boolean encrypt, int keylen, int blocksize, int ivlength) throws java.security.GeneralSecurityException
name
- name to print when presenting resultcipher
- formal name of algorithm to testprovider
- which encryption provider to useencrypt
- if true test encryption otherwise decryptionkeylen
- length of keys (bytes)blocksize
- length of block to encrypt (bytes)ivlength
- length of initialization vector (bytes)java.security.GeneralSecurityException
public static void benchHash(java.lang.String name, java.lang.String algorithm, java.lang.String provider, int blocksize) throws java.security.GeneralSecurityException
name
- name to print when presenting resultalgorithm
- formal name of algorithm to testblocksize
- length of block to operate onjava.security.GeneralSecurityException
public static void benchHash(java.lang.String name, java.lang.String algorithm)
public static void benchMac(java.lang.String name, java.lang.String algorithm, java.lang.String provider, int keylen, int blocksize) throws java.security.GeneralSecurityException
name
- name to print when presenting resultalgorithm
- formal name of algorithm to testkeylen
- length of keys (bytes)blocksize
- length of block to operate onjava.security.GeneralSecurityException
public static void benchMac(java.lang.String name, java.lang.String algorithm, int keylen)
public static void main(java.lang.String[] argv)