annotate test/compiler/7184394/TestAESMain.java @ 17911:f48e481abef0

8042281: compiler/7184394/TestAESMain.java fails with: javax.crypto.IllegalBlockSizeException: Input length not multiple of 16 bytes Summary: Added missing -DmsgSize=640 to test's run commands. Reviewed-by: kvn Contributed-by: shrinivas.joshi@oracle.com
author kvn
date Thu, 01 May 2014 17:57:29 -0700
parents 03214612e77e
children 52b4284cb496
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
1 /*
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
4 *
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
7 * published by the Free Software Foundation.
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
8 *
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
13 * accompanied this code).
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
14 *
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
18 *
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
21 * questions.
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
22 *
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
23 */
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
24
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
25 /**
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
26 * @test
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
27 * @bug 7184394
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
28 * @summary add intrinsics to use AES instructions
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
29 *
7427
2c7f594145dc 8004835: Improve AES intrinsics on x86
kvn
parents: 6894
diff changeset
30 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
31 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
32 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencOutputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
33 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DdecOutputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
34 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
35 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
17911
f48e481abef0 8042281: compiler/7184394/TestAESMain.java fails with: javax.crypto.IllegalBlockSizeException: Input length not multiple of 16 bytes
kvn
parents: 17910
diff changeset
36 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
7427
2c7f594145dc 8004835: Improve AES intrinsics on x86
kvn
parents: 6894
diff changeset
37 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB TestAESMain
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
38 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
39 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencOutputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
40 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DdecOutputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
41 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
42 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
17911
f48e481abef0 8042281: compiler/7184394/TestAESMain.java fails with: javax.crypto.IllegalBlockSizeException: Input length not multiple of 16 bytes
kvn
parents: 17910
diff changeset
43 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
44 *
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
45 * @author Tom Deneau
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
46 */
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
47
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
48 public class TestAESMain {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
49 public static void main(String[] args) {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
50 int iters = (args.length > 0 ? Integer.valueOf(args[0]) : 1000000);
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
51 int warmupIters = (args.length > 1 ? Integer.valueOf(args[1]) : 20000);
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
52 System.out.println(iters + " iterations");
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
53 TestAESEncode etest = new TestAESEncode();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
54 etest.prepare();
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
55 // warm-up
17670
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
56 System.out.println("Starting encryption warm-up");
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
57 for (int i=0; i<warmupIters; i++) {
17670
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
58 etest.run();
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
59 }
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
60 System.out.println("Finished encryption warm-up");
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
61 long start = System.nanoTime();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
62 for (int i=0; i<iters; i++) {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
63 etest.run();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
64 }
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
65 long end = System.nanoTime();
17670
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
66 System.out.println("TestAESEncode runtime was " + (double)((end - start)/1000000.0) + " ms");
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
67
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
68 TestAESDecode dtest = new TestAESDecode();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
69 dtest.prepare();
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
70 // warm-up
17670
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
71 System.out.println("Starting decryption warm-up");
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 17670
diff changeset
72 for (int i=0; i<warmupIters; i++) {
17670
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
73 dtest.run();
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
74 }
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
75 System.out.println("Finished decryption warm-up");
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
76 start = System.nanoTime();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
77 for (int i=0; i<iters; i++) {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
78 dtest.run();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
79 }
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
80 end = System.nanoTime();
17670
04d32e7fad07 8002074: Support for AES on SPARC
kvn
parents: 7427
diff changeset
81 System.out.println("TestAESDecode runtime was " + (double)((end - start)/1000000.0) + " ms");
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
82 }
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
83 }