RFR: 8365581: Optimize Java implementation of P256 arithmetic

Ben Perez bperez at openjdk.org
Thu Aug 21 23:30:08 UTC 2025


On Wed, 20 Aug 2025 15:16:47 GMT, Chen Liang <liach at openjdk.org> wrote:

> > What do you mean by "works"? And why doesn't it work for the zeroes?
> 
> As descirbed by [the documentation of `@Stable`](https://cr.openjdk.org/~jrose/jvm/Stable.html), a 0 value may be interpreted as "uncomputed" for lazy values, and the compiler will refuse to inline this value. As a result, in #26341, the 0 constants in arrays are explicitly rewritten instead.

Making the `modulus` array @Stable does in fact achieve the same performance boost for nonzero modulus values. Thanks for the tip!

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

PR Comment: https://git.openjdk.org/jdk/pull/26792#issuecomment-3212357835


More information about the security-dev mailing list