Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -49,7 +49,7 @@
*
* @author Valerie Peng
*
* @see AESCrypt
* @see AES_Crypt
* @see CipherBlockChaining
* @see ElectronicCodeBook
* @see CipherFeedback
Expand Down Expand Up @@ -174,7 +174,7 @@ static void checkKeySize(Key key, int fixedKeySize)
* PKCS5Padding.
*/
protected AESCipher(int keySize) {
core = new CipherCore(new AESCrypt(), AESConstants.AES_BLOCK_SIZE);
core = new CipherCore(new AES_Crypt(), AESConstants.AES_BLOCK_SIZE);
fixedKeySize = keySize;
}

Expand Down Expand Up @@ -504,7 +504,7 @@ protected int engineDoFinal(byte[] input, int inputOffset, int inputLen,
protected int engineGetKeySize(Key key) throws InvalidKeyException {
byte[] encoded = key.getEncoded();
Arrays.fill(encoded, (byte)0);
if (!AESCrypt.isKeySizeValid(encoded.length)) {
if (!AES_Crypt.isKeySizeValid(encoded.length)) {
throw new InvalidKeyException("Invalid AES key length: " +
encoded.length + " bytes");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -91,7 +91,7 @@ protected void engineInit(AlgorithmParameterSpec params,
*/
protected void engineInit(int keysize, SecureRandom random) {
if (((keysize % 8) != 0) ||
(!AESCrypt.isKeySizeValid(keysize/8))) {
(!AES_Crypt.isKeySizeValid(keysize/8))) {
throw new InvalidParameterException
("Wrong keysize: must be equal to 128, 192 or 256");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -50,7 +50,7 @@ class AESKeyWrap extends FeedbackCipher {
};

AESKeyWrap() {
super(new AESCrypt());
super(new AES_Crypt());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -87,7 +87,7 @@ private static int validateIV(byte[] ivAndLen, byte[] iv)
}

AESKeyWrapPadded() {
super(new AESCrypt());
super(new AES_Crypt());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/com/sun/crypto/provider/GCTR.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -40,7 +40,7 @@
* to 16 bytes.
*
* If any invariant is broken, failures can occur because the
* AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM
* AES_Crypt.encryptBlock method can be intrinsified on the HotSpot VM
* (see JDK-8067648 for details).
*
* The counter mode operations can be intrinsified and parallelized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ abstract class GaloisCounterMode extends CipherSpi {
/**
*
* @param keySize length of key.
* @param embeddedCipher Cipher object, such as AESCrypt.
* @param embeddedCipher Cipher object, such as AES_Crypt.
*/
GaloisCounterMode(int keySize, SymmetricCipher embeddedCipher) {
blockCipher = embeddedCipher;
Expand Down Expand Up @@ -198,7 +198,7 @@ protected int engineGetOutputSize(int inputLen) {
protected int engineGetKeySize(Key key) throws InvalidKeyException {
byte[] encoded = key.getEncoded();
Arrays.fill(encoded, (byte)0);
if (!AESCrypt.isKeySizeValid(encoded.length)) {
if (!AES_Crypt.isKeySizeValid(encoded.length)) {
throw new InvalidKeyException("Invalid key length: " +
encoded.length + " bytes");
}
Expand Down Expand Up @@ -1693,25 +1693,25 @@ int decryptBlocks(GCMOperation op, byte[] in, int inOfs, int inLen,

public static final class AESGCM extends GaloisCounterMode {
public AESGCM() {
super(-1, new AESCrypt());
super(-1, new AES_Crypt());
}
}

public static final class AES128 extends GaloisCounterMode {
public AES128() {
super(16, new AESCrypt());
super(16, new AES_Crypt());
}
}

public static final class AES192 extends GaloisCounterMode {
public AES192() {
super(24, new AESCrypt());
super(24, new AES_Crypt());
}
}

public static final class AES256 extends GaloisCounterMode {
public AES256() {
super(32, new AESCrypt());
super(32, new AES_Crypt());
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -137,7 +137,7 @@ private static byte[] checkKey(Key key, int fixedKeySize)
}
int keyLen = keyBytes.length;
if (!key.getAlgorithm().equalsIgnoreCase("AES") ||
!AESCrypt.isKeySizeValid(keyLen) ||
!AES_Crypt.isKeySizeValid(keyLen) ||
(fixedKeySize != -1 && fixedKeySize != keyLen)) {
throw new InvalidKeyException("Invalid key length: " +
keyLen + " bytes");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -68,7 +68,7 @@ abstract class PBES2Core extends CipherSpi {

if (cipherAlgo.equals("AES")) {
blkSize = AESConstants.AES_BLOCK_SIZE;
cipher = new CipherCore(new AESCrypt(), blkSize);
cipher = new CipherCore(new AES_Crypt(), blkSize);

switch(kdfAlgo) {
case "HmacSHA1":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,7 +36,7 @@
* @author Jan Luehe
*
*
* @see AESCrypt
* @see AES_Crypt
* @see DESCrypt
* @see DESedeCrypt
* @see BlowfishCrypt
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -155,7 +155,7 @@ public class TestAESMain {
public static void main(String[] args) {
String mode = System.getProperty("mode", "CBC");
if ((mode.equals("CBC") || mode.equals("ECB")) &&
!Compiler.isIntrinsicAvailable(CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION, "com.sun.crypto.provider.AESCrypt", "implEncryptBlock", byte[].class, int.class, byte[].class, int.class)) {
!Compiler.isIntrinsicAvailable(CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION, "com.sun.crypto.provider.AES_Crypt", "implEncryptBlock", byte[].class, int.class, byte[].class, int.class)) {
throw new SkippedException("AES intrinsic is not available");
}
if (mode.equals("GCM") &&
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/compiler/cpuflags/AESIntrinsicsBase.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -31,7 +31,7 @@ public abstract class AESIntrinsicsBase {
+ ".provider\\.CipherBlockChaining::"
+ "(implEncrypt|implDecrypt) \\([0-9]+ bytes\\)\\s+\\(intrinsic[,\\)]";
public static final String AES_INTRINSIC = "com\\.sun\\.crypto\\"
+ ".provider\\.AESCrypt::(implEncryptBlock|implDecryptBlock) \\([0-9]+ "
+ ".provider\\.AES_Crypt::(implEncryptBlock|implDecryptBlock) \\([0-9]+ "
+ "bytes\\)\\s+\\(intrinsic[,\\)]";
public static final String USE_AES = "UseAES";
public static final String USE_AES_INTRINSICS = "UseAESIntrinsics";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -114,7 +114,7 @@ public void getIntrinsificationTrustPredicateTest() throws Exception {
VirtualObjectLayoutTest.class,
TestHotSpotJVMCIRuntime.class));
try {
classes.add(Class.forName("com.sun.crypto.provider.AESCrypt"));
classes.add(Class.forName("com.sun.crypto.provider.AES_Crypt"));
classes.add(Class.forName("com.sun.crypto.provider.CipherBlockChaining"));
} catch (ClassNotFoundException e) {
// Extension classes not available
Expand Down