Methods Summary |
---|
public void | checkEncodedData(byte[] original, byte[] encoded)
for(int i = 0; i < original.length; i++) {
if (original[i] != encoded[i]) {
throw new Exception("Source and encoded data not match " +
getCipherParameters());
}
}
|
public abstract void | crypt()
|
public java.lang.String | getAlgName()
return algName;
|
public java.lang.String | getAlgorithmName()
return algName;
|
public java.lang.String | getCipherParameters()
return "Alg name:" + algName + " Key:" + keyLength + " Mode:" + mode +
" Padding:" + paddingMode;
|
public java.lang.String | getData()
return data;
|
public java.lang.String | getFailureMessages()
return (errorSB == null) ? "" : new String(errorSB);
|
public int | getKeyLength()
return keyLength;
|
public java.lang.String | getMode()
return mode;
|
public int | getNextKey()
kCounter = (hasNextKey()) ? kCounter : 0;
return keyLengthAr[kCounter++];
|
public java.lang.String | getNextMode()
mCounter = (hasNextMode()) ? mCounter : 0;
return modeAr[mCounter++];
|
public java.lang.String | getNextPadding()
pCounter = (hasNextPadding()) ? pCounter : 0;
return paddingModeAr[pCounter++];
|
public java.lang.String | getPadding()
return paddingMode;
|
public boolean | getTestStatus()
return flagTestResult;
|
public long | getTotalCasesNumber()
return keyLengthAr.length * modeAr.length * paddingModeAr.length;
|
public long | getTotalFailuresNumber()
return fails;
|
public boolean | hasNextKey()
return (kCounter < keyLengthAr.length);
|
public boolean | hasNextMode()
return (mCounter < modeAr.length);
|
public boolean | hasNextPadding()
return (pCounter < paddingModeAr.length);
|
public void | launcher()
Thread thread = null;
do {
keyLength = getNextKey();
do {
mode = getNextMode();
do {
paddingMode = getNextPadding();
thread = new Thread(this);
thread.start();
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
} while (hasNextPadding());
} while (hasNextMode());
} while (hasNextKey());
|
public void | run()
try {
crypt();
} catch (Exception e) {
if(errorSB == null) {
errorSB = new StringBuffer();
}
errorSB.append(e.getMessage());
errorSB.append("\n");
errorSB.append(getCipherParameters());
errorSB.append("\n");
StackTraceElement[] st = e.getStackTrace();
for (int i = 0; i < st.length; i++) {
errorSB.append(st[i].toString());
errorSB.append("\n");
}
fails++;
return;
}
flagTestResult = true;
|