On Fri, 7 Aug 2026 18:40:11 GMT, Mark Powers <[email protected]> wrote:

> https://bugs.openjdk.org/browse/JDK-8381223
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/share/classes/sun/security/provider/ML_DSA.java line 1454:

> 1452:             // coeffs1 is in the ordinary NTT domain and coeffs2 is in 
> the
> 1453:             // Montgomery NTT domain. Their ordinary product is 
> therefore in
> 1454:             // the Montgomery domain; no conversion of coeffs2 is 
> necessary.

With your update this comment is no longer valid ;).  Both inputs and product 
are in the ordinary NTT domain.  Suggestion:
>             // Both input coefficients are in the ordinary NTT domain, 
> therefore
>             // the product is in the same domain.

src/java.base/share/classes/sun/security/provider/ML_DSA.java line 1632:

> 1630:         long r = value - quotient * ML_DSA_Q;
> 1631:         r -= ML_DSA_Q & ~((r - ML_DSA_Q) >> 63);
> 1632:         r += (r >> 63) & ML_DSA_Q;

The numbers look good, nice work!

Suggestion: add constant
> private static final int BARRETT_SHIFT = 63;

and use for these statements.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32259#discussion_r3788034921
PR Review Comment: https://git.openjdk.org/jdk/pull/32259#discussion_r3781778501

Reply via email to