kvn@4205: /* kvn@6312: * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved. kvn@4205: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. kvn@4205: * kvn@4205: * This code is free software; you can redistribute it and/or modify it kvn@4205: * under the terms of the GNU General Public License version 2 only, as kvn@4205: * published by the Free Software Foundation. kvn@4205: * kvn@4205: * This code is distributed in the hope that it will be useful, but WITHOUT kvn@4205: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or kvn@4205: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License kvn@4205: * version 2 for more details (a copy is included in the LICENSE file that kvn@4205: * accompanied this code). kvn@4205: * kvn@4205: * You should have received a copy of the GNU General Public License version kvn@4205: * 2 along with this work; if not, write to the Free Software Foundation, kvn@4205: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. kvn@4205: * kvn@4205: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA kvn@4205: * or visit www.oracle.com if you need additional information or have any kvn@4205: * questions. kvn@4205: * kvn@4205: */ kvn@4205: kvn@4205: /** kvn@4205: * @test kvn@4205: * @bug 7184394 kvn@4205: * @summary add intrinsics to use AES instructions kvn@4205: * kvn@4363: * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain kvn@4363: * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB TestAESMain kvn@4205: * kvn@4205: * @author Tom Deneau kvn@4205: */ kvn@4205: kvn@4205: public class TestAESMain { kvn@4205: public static void main(String[] args) { kvn@4205: int iters = (args.length > 0 ? Integer.valueOf(args[0]) : 1000000); kvn@4205: System.out.println(iters + " iterations"); kvn@4205: TestAESEncode etest = new TestAESEncode(); kvn@4205: etest.prepare(); kvn@6312: // warm-up for 20K iterations kvn@6312: System.out.println("Starting encryption warm-up"); kvn@6312: for (int i=0; i<20000; i++) { kvn@6312: etest.run(); kvn@6312: } kvn@6312: System.out.println("Finished encryption warm-up"); kvn@4205: long start = System.nanoTime(); kvn@4205: for (int i=0; i