Path: blob/master/test/hotspot/jtreg/compiler/intrinsics/sha/sanity/TestSHA3MultiBlockIntrinsics.java
41161 views
/*1* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2020, Huawei Technologies Co., Ltd. All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/**25* @test26* @bug 825220427* @summary Verify that SHA3-224, SHA3-256, SHA3-384, SHA3-512 multi block intrinsic is actually used.28*29* @library /test/lib /30* @modules java.base/jdk.internal.misc31* java.management32*33* @build sun.hotspot.WhiteBox34* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox35* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions36* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50037* -XX:Tier4InvocationThreshold=50038* -XX:+LogCompilation -XX:LogFile=positive_224.log39* -XX:CompileOnly=sun/security/provider/DigestBase40* -XX:CompileOnly=sun/security/provider/SHA341* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics42* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics43* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-22444* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics45* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions46* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50047* -XX:Tier4InvocationThreshold=50048* -XX:+LogCompilation -XX:LogFile=positive_224_def.log49* -XX:CompileOnly=sun/security/provider/DigestBase50* -XX:CompileOnly=sun/security/provider/SHA351* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-22452* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics53* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions54* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50055* -XX:Tier4InvocationThreshold=50056* -XX:+LogCompilation -XX:LogFile=negative_224.log57* -XX:CompileOnly=sun/security/provider/DigestBase58* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA59* -Dalgorithm=SHA3-22460* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics61*62* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions63* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50064* -XX:Tier4InvocationThreshold=50065* -XX:+LogCompilation -XX:LogFile=positive_256.log66* -XX:CompileOnly=sun/security/provider/DigestBase67* -XX:CompileOnly=sun/security/provider/SHA368* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics69* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics70* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-25671* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics72* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions73* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50074* -XX:Tier4InvocationThreshold=50075* -XX:+LogCompilation -XX:LogFile=positive_256_def.log76* -XX:CompileOnly=sun/security/provider/DigestBase77* -XX:CompileOnly=sun/security/provider/SHA378* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-25679* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics80* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions81* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50082* -XX:Tier4InvocationThreshold=50083* -XX:+LogCompilation -XX:LogFile=negative_256.log84* -XX:CompileOnly=sun/security/provider/DigestBase85* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA86* -Dalgorithm=SHA3-25687* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics88*89* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions90* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=50091* -XX:Tier4InvocationThreshold=50092* -XX:+LogCompilation -XX:LogFile=positive_384.log93* -XX:CompileOnly=sun/security/provider/DigestBase94* -XX:CompileOnly=sun/security/provider/SHA395* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics96* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics97* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-38498* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics99* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions100* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500101* -XX:Tier4InvocationThreshold=500102* -XX:+LogCompilation -XX:LogFile=positive_384_def.log103* -XX:CompileOnly=sun/security/provider/DigestBase104* -XX:CompileOnly=sun/security/provider/SHA3105* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-384106* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics107* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions108* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500109* -XX:Tier4InvocationThreshold=500110* -XX:+LogCompilation -XX:LogFile=negative_384.log111* -XX:CompileOnly=sun/security/provider/DigestBase112* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA113* -Dalgorithm=SHA3-384114* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics115*116* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions117* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500118* -XX:Tier4InvocationThreshold=500119* -XX:+LogCompilation -XX:LogFile=positive_512.log120* -XX:CompileOnly=sun/security/provider/DigestBase121* -XX:CompileOnly=sun/security/provider/SHA3122* -XX:+UseSHA3Intrinsics -XX:-UseMD5Intrinsics123* -XX:-UseSHA1Intrinsics -XX:-UseSHA256Intrinsics124* -XX:-UseSHA512Intrinsics -Dalgorithm=SHA3-512125* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics126* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions127* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500128* -XX:Tier4InvocationThreshold=500129* -XX:+LogCompilation -XX:LogFile=positive_512_def.log130* -XX:CompileOnly=sun/security/provider/DigestBase131* -XX:CompileOnly=sun/security/provider/SHA3132* -XX:+UseSHA3Intrinsics -Dalgorithm=SHA3-512133* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics134* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions135* -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500136* -XX:Tier4InvocationThreshold=500137* -XX:+LogCompilation -XX:LogFile=negative_512.log138* -XX:CompileOnly=sun/security/provider/DigestBase139* -XX:CompileOnly=sun/security/provider/SHA3 -XX:-UseSHA140* -Dalgorithm=SHA3-512141* compiler.intrinsics.sha.sanity.TestSHA3MultiBlockIntrinsics142* @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE143* compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log144* positive_384.log positive_512.log positive_224_def.log positive_256_def.log145* positive_384_def.log positive_512_def.log negative_224.log negative_256.log146* negative_384.log negative_512.log147*/148149package compiler.intrinsics.sha.sanity;150151import compiler.testlibrary.sha.predicate.IntrinsicPredicates;152153public class TestSHA3MultiBlockIntrinsics {154public static void main(String args[]) throws Exception {155new DigestSanityTestBase(IntrinsicPredicates.isSHA3IntrinsicAvailable(),156DigestSanityTestBase.MB_INTRINSIC_ID).test();157}158}159160161