On Wed, 15 Jun 2022 20:17:47 GMT, Mark Powers <d...@openjdk.org> wrote:
>> Clearing buffers and temporary arrays to avoid data leaks in cipher >> operations. > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java > line 1014: > >> 1012: dst.flip(); >> 1013: originalDst.put(dst); >> 1014: dst.clear().put(new byte[dst.capacity()]); > > If `dst` is an array-backed ByteByffer, could you use `Array.fill` to avoid a > memory allocation? It's surprising to me that ByteBuffer doesn't have a > method to set all of the bytes in the ByteBuffer. Yes, we can. ------------- PR: https://git.openjdk.org/jdk/pull/9158