test/compiler/7184394/TestAESBase.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/test/compiler/7184394/TestAESBase.java	Fri Dec 14 19:10:21 2012
--- new/test/compiler/7184394/TestAESBase.java	Fri Dec 14 19:10:20 2012

*** 52,62 **** --- 52,61 ---- Cipher cipher; Cipher dCipher; String paddingStr = "PKCS5Padding"; AlgorithmParameters algParams; SecretKey key; int ivLen; static int numThreads = 0; int threadId; static synchronized int getThreadId() { int id = numThreads;
*** 66,76 **** --- 65,75 ---- abstract public void run(); public void prepare() { try { ! System.out.println("\nmsgSize=" + msgSize + ", key size=" + keySize + ", reInit=" + !noReinit + ", checkOutput=" + checkOutput); ! System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit + ", checkOutput=" + checkOutput); int keyLenBytes = (keySize == 0 ? 16 : keySize/8); byte keyBytes[] = new byte[keyLenBytes]; if (keySize == 128) keyBytes = new byte[] {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
*** 88,101 **** --- 87,104 ---- } cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE"); dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE"); ! ivLen = (algorithm.equals("AES") ? 16 : algorithm.equals("DES") ? 8 : 0); ! if (mode.equals("CBC")) { + int ivLen = (algorithm.equals("AES") ? 16 : algorithm.equals("DES") ? 8 : 0); IvParameterSpec initVector = new IvParameterSpec(new byte[ivLen]); cipher.init(Cipher.ENCRYPT_MODE, key, initVector); + } else { + algParams = cipher.getParameters(); + cipher.init(Cipher.ENCRYPT_MODE, key, algParams); + } algParams = cipher.getParameters(); dCipher.init(Cipher.DECRYPT_MODE, key, algParams); if (threadId == 0) { childShowCipher(); }

test/compiler/7184394/TestAESBase.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File