On Fri, 9 Oct 2020 02:38:05 GMT, Valerie Peng <valer...@openjdk.org> wrote:
>> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Xuelei comments > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java > line 614: > >> 612: } >> 613: >> 614: checkDataLength(processed, len); > > It seems that both checks (line 605 and 614) can be combined into: > checkDataLength(processed, Math.addExact(len, tagLenBytes)); I changed both encryptFinal for byte[] and bytebuffer, as I got that check from copying the byte[] method. They do look like mostly redundant checks, and I moved them to the top. ------------- PR: https://git.openjdk.java.net/jdk/pull/411