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

Shawn M Emery duke at openjdk.org
Sun Nov 9 23:11:02 UTC 2025


On Sun, 9 Nov 2025 19:42:44 GMT, Ferenc Rakoczi <duke at openjdk.org> wrote:

>> Thank you for your review.  The byte assignments were to avoid three redundant shift operations.
>
> What were those "redundant shifts"? 
> What I am suggesting is:
>  return (SBOX(word >>>24] << 24) |
>              (SBOX[(word >> 16) & 0xFF] << 16) |
>              (SBOX[(word >> 8) & 0xFF] << 8) |
>              SBOX[word & 0xFF];
> 
> if you define SBOX as an int[256] array.

Yes, this would definitely speed up key schedule generation, but at the cost of additional memory; +768 bytes per instance, where the total AES cipher would be 1,268 bytes more per instance than the original Cryptix implementation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28188#discussion_r2508383356


More information about the security-dev mailing list