Mercurial > hg > graal-compiler
changeset 22805:b058d6325c2e
Update crypto tests for 1.9
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 12 Oct 2015 20:05:18 -0700 |
parents | 078298728607 |
children | a1f3697dd144 |
files | graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Mon Oct 12 18:17:24 2015 -0700 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Mon Oct 12 20:05:18 2015 -0700 @@ -24,6 +24,8 @@ import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.ROOT_COMPILATION; import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; +import static sun.misc.Version.jdkMajorVersion; +import static sun.misc.Version.jdkMinorVersion; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; @@ -89,7 +91,8 @@ @Test public void testAESCryptIntrinsics() throws Exception { - if (compileAndInstall("com.sun.crypto.provider.AESCrypt", "encryptBlock", "decryptBlock")) { + String[] methods = jdkMajorVersion() >= 1 && jdkMinorVersion() <= 8 ? new String[]{"encryptBlock", "decryptBlock"} : new String[]{"implEncryptBlock", "implDecryptBlock"}; + if (compileAndInstall("com.sun.crypto.provider.AESCrypt", methods)) { ByteArrayOutputStream actual = new ByteArrayOutputStream(); actual.write(runEncryptDecrypt(aesKey, "AES/CBC/NoPadding")); actual.write(runEncryptDecrypt(aesKey, "AES/CBC/PKCS5Padding")); @@ -99,7 +102,8 @@ @Test public void testCipherBlockChainingIntrinsics() throws Exception { - if (compileAndInstall("com.sun.crypto.provider.CipherBlockChaining", "encrypt", "decrypt")) { + String[] methods = jdkMajorVersion() >= 1 && jdkMinorVersion() <= 8 ? new String[]{"encrypt", "decrypt"} : new String[]{"implEncrypt", "implDecrypt"}; + if (compileAndInstall("com.sun.crypto.provider.CipherBlockChaining", methods)) { ByteArrayOutputStream actual = new ByteArrayOutputStream(); actual.write(runEncryptDecrypt(aesKey, "AES/CBC/NoPadding")); actual.write(runEncryptDecrypt(aesKey, "AES/CBC/PKCS5Padding"));