src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java
changeset 51052 080776992b29
parent 47216 71c04702a3d5
--- a/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java	Thu Jul 12 08:44:39 2018 +0800
+++ b/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java	Fri Jul 13 02:36:42 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -39,7 +39,6 @@
 import java.security.InvalidKeyException;
 import java.security.MessageDigest;
 import java.util.Arrays;
-import java.util.Objects;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
 
@@ -351,8 +350,8 @@
      */
     void encryptBlock(byte[] in, int inOffset,
                       byte[] out, int outOffset) {
-        Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length);
-        Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length);
+        // Array bound checks are done in caller code, i.e.
+        // FeedbackCipher.encrypt/decrypt(...) to improve performance.
         implEncryptBlock(in, inOffset, out, outOffset);
     }
 
@@ -430,8 +429,8 @@
      */
     void decryptBlock(byte[] in, int inOffset,
                       byte[] out, int outOffset) {
-        Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length);
-        Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length);
+        // Array bound checks are done in caller code, i.e.
+        // FeedbackCipher.encrypt/decrypt(...) to improve performance.
         implDecryptBlock(in, inOffset, out, outOffset);
     }