test/compiler/7184394/TestAESDecode.java

Thu, 26 Sep 2013 10:25:02 -0400

author
hseigel
date
Thu, 26 Sep 2013 10:25:02 -0400
changeset 5784
190899198332
parent 4205
a3ecd773a7b9
child 6653
03214612e77e
permissions
-rw-r--r--

7195622: CheckUnhandledOops has limited usefulness now
Summary: Enable CHECK_UNHANDLED_OOPS in fastdebug builds across all supported platforms.
Reviewed-by: coleenp, hseigel, dholmes, stefank, twisti, ihse, rdurbin
Contributed-by: lois.foltan@oracle.com

kvn@4205 1 /*
kvn@4205 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
kvn@4205 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
kvn@4205 4 *
kvn@4205 5 * This code is free software; you can redistribute it and/or modify it
kvn@4205 6 * under the terms of the GNU General Public License version 2 only, as
kvn@4205 7 * published by the Free Software Foundation.
kvn@4205 8 *
kvn@4205 9 * This code is distributed in the hope that it will be useful, but WITHOUT
kvn@4205 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kvn@4205 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kvn@4205 12 * version 2 for more details (a copy is included in the LICENSE file that
kvn@4205 13 * accompanied this code).
kvn@4205 14 *
kvn@4205 15 * You should have received a copy of the GNU General Public License version
kvn@4205 16 * 2 along with this work; if not, write to the Free Software Foundation,
kvn@4205 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
kvn@4205 18 *
kvn@4205 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
kvn@4205 20 * or visit www.oracle.com if you need additional information or have any
kvn@4205 21 * questions.
kvn@4205 22 *
kvn@4205 23 */
kvn@4205 24
kvn@4205 25 /**
kvn@4205 26 * @author Tom Deneau
kvn@4205 27 */
kvn@4205 28
kvn@4205 29 import javax.crypto.Cipher;
kvn@4205 30
kvn@4205 31 public class TestAESDecode extends TestAESBase {
kvn@4205 32 @Override
kvn@4205 33 public void run() {
kvn@4205 34 try {
kvn@4205 35 if (!noReinit) dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
kvn@4205 36 if (checkOutput) {
kvn@4205 37 // checked version creates new output buffer each time
kvn@4205 38 decode = dCipher.doFinal(encode, 0, encode.length);
kvn@4205 39 compareArrays(decode, expectedDecode);
kvn@4205 40 } else {
kvn@4205 41 // non-checked version outputs to existing encode buffer for maximum speed
kvn@4205 42 decode = new byte[dCipher.getOutputSize(encode.length)];
kvn@4205 43 dCipher.doFinal(encode, 0, encode.length, decode);
kvn@4205 44 }
kvn@4205 45 }
kvn@4205 46 catch (Exception e) {
kvn@4205 47 e.printStackTrace();
kvn@4205 48 System.exit(1);
kvn@4205 49 }
kvn@4205 50 }
kvn@4205 51
kvn@4205 52 @Override
kvn@4205 53 void childShowCipher() {
kvn@4205 54 showCipher(dCipher, "Decryption");
kvn@4205 55 }
kvn@4205 56
kvn@4205 57 }

mercurial