On Fri, 4 Oct 2024 20:59:45 GMT, Ben Perez <bpe...@openjdk.org> wrote:

> Java implementation of ML-DSA, the FIPS 204 post-quantum signature scheme 
> https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.204.pdf. Depends on 
> https://github.com/openjdk/jdk/pull/21167

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

> 43:     private static final int montRModQ = 4193792;
> 44:     private static final int montDimInverse = 16382; // 
> toMont((mlDsa_n)^-1 (mod mlDsa_q))
> 45:     private static final int[] montZetasForNtt = new int[]{

It would be nice to link to a source for these magic values in the comments, 
unless we are generating some of these values ourselves.

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

> 416: 
> 417:     public ML_DSA(int security_level) {
> 418:         switch (security_level) {

Might want a comment about why there are only `security_level` values of 2, 3, 
& 5.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21364#discussion_r1792109302
PR Review Comment: https://git.openjdk.org/jdk/pull/21364#discussion_r1792111251

Reply via email to