/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/**
* @author Tom Deneau
*/
abstract public class TestAESBase {
byte[] input;
byte[] encode;
byte[] expectedEncode;
byte[] decode;
byte[] expectedDecode;
int threadId;
static synchronized int getThreadId() {
int id = numThreads;
numThreads++;
return id;
}
abstract public void run();
public void prepare() {
try {
System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit + ", checkOutput=" + checkOutput);
byte keyBytes[] = new byte[keyLenBytes];
if (keySize == 128)
else
if (threadId == 0) {
}
input[i] = (byte) (i & 0xff);
}
} else {
}
if (threadId == 0) {
}
// do one encode and decode in preparation
// this will also create the encode buffer and decode buffer
if (checkOutput) {
}
}
catch (Exception e) {
e.printStackTrace();
}
}
}
}
showArray(b, "test: ");
}
if (b[i] != exp[i]) {
System.out.format("output error at index %d: got %02x, expected %02x\n", i, b[i] & 0xff, exp[i] & 0xff);
showArray(b, "test: ");
}
}
}
}
abstract void childShowCipher();
}