RFR: 8371450: AES performance improvements for key schedule generation [v3]

Valerie Peng valeriep at openjdk.org
Mon Nov 10 21:16:07 UTC 2025


On Sun, 9 Nov 2025 04:31:51 GMT, Shawn M Emery <duke at openjdk.org> wrote:

>> This fix improves performance in the AES key schedule generation by eliminating an unnecessary object and unnecessary mask in the inverse key schedule.
>> 
>> The micro:org.openjdk.bench.javax.crypto.AESReinit benchmark results are improved by 6.96% for arm64 and 7.79% for x86_64.
>> 
>> Thank you @jnimeh for catching the unnecessary byte mask!
>
> Shawn M Emery has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Clean up comments - take two

src/java.base/share/classes/com/sun/crypto/provider/AES_Crypt.java line 974:

> 972:      * Generate the inverse cipher round keys.
> 973:      *
> 974:      * @param w [in] the targeted word for substituion.

nit: substitution

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

> 973:      *
> 974:      * @param w [in] the targeted word for substituion.
> 975:      * @param rounds [in] the number rounds for generating the round keys.

nit: missing "of"?

src/java.base/share/classes/com/sun/crypto/provider/AES_Crypt.java line 1011:

> 1009: 
> 1010:     /**
> 1011:      * Subtitute the word as a step of key expansion.

nit: Substitute

src/java.base/share/classes/com/sun/crypto/provider/AES_Crypt.java line 1013:

> 1011:      * Subtitute the word as a step of key expansion.
> 1012:      *
> 1013:      * @param word [in] the targeted word for substituion.

nit: substitution

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28188#discussion_r2511986644
PR Review Comment: https://git.openjdk.org/jdk/pull/28188#discussion_r2511988103
PR Review Comment: https://git.openjdk.org/jdk/pull/28188#discussion_r2511982055
PR Review Comment: https://git.openjdk.org/jdk/pull/28188#discussion_r2511983052


More information about the security-dev mailing list