Skip to content

Commit b03e6b4

Browse files
committed
Improve comment and minor cleanup.
1 parent 477a3dd commit b03e6b4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/hotspot/share/opto/library_call.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7475,15 +7475,16 @@ bool LibraryCallKit::inline_counterMode_AESCrypt(vmIntrinsics::ID id) {
74757475

74767476
//------------------------------get_key_start_from_aescrypt_object-----------------------
74777477
Node * LibraryCallKit::get_key_start_from_aescrypt_object(Node *aescrypt_object) {
7478-
#if defined(PPC64) || defined(S390) || defined(RISCV64)
74797478
// MixColumns for decryption can be reduced by preprocessing MixColumns with round keys.
74807479
// Intel's extension is based on this optimization and AESCrypt generates round keys by preprocessing MixColumns.
74817480
// However, ppc64 vncipher processes MixColumns and requires the same round keys with encryption.
74827481
// The ppc64, s390 and riscv64 stubs of encryption and decryption use the same round keys.
7483-
Node* objAESCryptKey = load_field_from_object(aescrypt_object, "sessionKe", "[I");
7482+
#if defined(PPC64) || defined(S390) || defined(RISCV64)
7483+
const char* key_name = "sessionKe";
74847484
#else
7485-
Node* objAESCryptKey = load_field_from_object(aescrypt_object, "K", "[I");
7485+
const char* key_name = "K";
74867486
#endif // PPC64
7487+
Node* objAESCryptKey = load_field_from_object(aescrypt_object, key_name, "[I");
74877488
assert (objAESCryptKey != nullptr, "wrong version of com.sun.crypto.provider.AES_Crypt");
74887489
if (objAESCryptKey == nullptr) return (Node *) nullptr;
74897490

src/java.base/share/classes/com/sun/crypto/provider/AES_Crypt.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ final class AES_Crypt extends SymmetricCipher {
5454
private int rounds;
5555
private byte[] prevKey = null;
5656

57-
// Following attribute is specific to Intrinsics where the unprocessed
58-
// key is used for PPC64, S390, and RISCV64 architectures, whereas K is
59-
// used for everything else.
57+
// Following attributes (sessionKe and K) are specific to Intrinsics, where
58+
// sessionKe is the unprocessed key that is used for PPC64, S390 and
59+
// RISCV64 architectures, whereas K is used for everything else.
6060
private int[] sessionKe = null; // key for encryption
6161
private int[] sessionKd = null; // preprocessed key for decryption
6262
private int[] K = null; // preprocessed key in case of decryption

0 commit comments

Comments
 (0)