RFR: 8253821: Improve ByteBuffer performance with GCM [v5]

Anthony Scarpino ascarpino at openjdk.java.net
Wed Dec 2 03:36:10 UTC 2020


On Wed, 2 Dec 2020 00:02:52 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Anthony Scarpino has updated the pull request incrementally with five additional commits since the last revision:
>> 
>>  - test updates
>>  - test check mixup
>>  - Overlap protection
>>  - Updated code comments, all tests pass
>>  - Updated code comments, all tests pass
>
> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 1000:
> 
>> 998:         tmp.position(dst.position());
>> 999:         bb.put(tmp);
>> 1000:         bb.flip();
> 
> Since we don't need to read the content of output buffer, I suppose we can just do ByteBuffer.allocate(dst.remaining())?

yes, remaining() is good here.

-------------

PR: https://git.openjdk.java.net/jdk/pull/411



More information about the security-dev mailing list