On Thu, 20 May 2021 23:27:51 GMT, Valerie Peng <valer...@openjdk.org> wrote:
>> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java > line 1317: > >> 1315: * If tagOfs = 0, 'in' contains only the tag >> 1316: * if tagOfs = blockSize, there is no data in 'in' and all the >> tag >> 1317: * is in ibuffer > > Is this correct? mergeBlock() returns the number of used bytes from 'in', if > no data is in 'in' and all the tag is from 'ibuffer', tagOfs should equal to > -tagLenBytes. The next line should be moved up as the tag position gradually > shifts from 'in' toward 'ibuffer'. The tagOfs for the next line should be > -tagLenBytes < tagOfs < 0? Yeah, I reworkded it > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java > line 1401: > >> 1399: ShortBufferException { >> 1400: GHASH save = null; >> 1401: > > Should do ArrayUtil.nullAndBoundsCheck() on 'in'? that was done in engineDoFinal ------------- PR: https://git.openjdk.java.net/jdk/pull/4072