annotate test/compiler/7184394/TestAESDecode.java @ 20304:a22acf6d7598

8048112: G1 Full GC needs to support the case when the very first region is not available Summary: Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett. Reviewed-by: brutisso
author tschatzl
date Mon, 21 Jul 2014 10:00:31 +0200
parents 03214612e77e
children
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: 6894
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 * @author Tom Deneau
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
27 */
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
28
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
29 import javax.crypto.Cipher;
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
30
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
31 public class TestAESDecode extends TestAESBase {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
32 @Override
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
33 public void run() {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
34 try {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
35 if (!noReinit) dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
17910
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 6894
diff changeset
36 decode = new byte[decodeLength];
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 6894
diff changeset
37 if (testingMisalignment) {
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 6894
diff changeset
38 int tempSize = dCipher.update(encode, encOutputOffset, (decodeMsgSize - lastChunkSize), decode, decOutputOffset);
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 6894
diff changeset
39 dCipher.doFinal(encode, (encOutputOffset + decodeMsgSize - lastChunkSize), lastChunkSize, decode, (decOutputOffset + tempSize));
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 6894
diff changeset
40 } else {
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 6894
diff changeset
41 dCipher.doFinal(encode, encOutputOffset, decodeMsgSize, decode, decOutputOffset);
03214612e77e 8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
kvn
parents: 6894
diff changeset
42 }
6894
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
43 if (checkOutput) {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
44 compareArrays(decode, expectedDecode);
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
45 }
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 catch (Exception e) {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
48 e.printStackTrace();
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
49 System.exit(1);
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
50 }
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
51 }
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
52
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
53 @Override
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
54 void childShowCipher() {
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
55 showCipher(dCipher, "Decryption");
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
56 }
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
57
a3ecd773a7b9 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
58 }