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

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Wed Dec 23 13:25:09 UTC 2020


On Wed, 2 Dec 2020 05:01:28 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:

>> 8253821: Improve ByteBuffer performance with GCM
>
> Anthony Scarpino has updated the pull request incrementally with one additional commit since the last revision:
> 
>   comments v4

src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 975:

> 973:             if (!src.isReadOnly()) {
> 974:                 // If using the heap, check underlying byte[] address.
> 975:                 if (!src.array().equals(dst.array()) ) {

It looks a bit confusing to me to compare arrays with `equals` method call.
Perhaps its worth to use `==` instead to avoid mistreating and make code more readable.

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

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



More information about the security-dev mailing list