On Thu, 3 Jun 2021 22:07:34 GMT, Valerie Peng <valer...@openjdk.org> wrote:
>> Anthony Scarpino has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - missed resultLen and undo decrypt heap hasarray check >> - code review comments >> - fix > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java > line 776: > >> 774: if (dst != null) { >> 775: dst.put(block, 0, len); >> 776: } > > Can this be "resultLen += op.doFinal(block, 0, len, dst)"? doFinal doesn't have a (byte[], int, int, ByteBuffer) method. While that's not a bad idea to have one, it would be a fair bit of code to do it because it's part of the GCM interface and I'd have to write methods for GCTRGHASH, GCTR, and GHASH. I think that's too much just for this one code segment that isn't broken. ------------- PR: https://git.openjdk.java.net/jdk/pull/4072