On Wed, 2 Dec 2026 09:15:39 GMT, Andrew Dinn <[email protected]> wrote:

>> This bug fix brings into parity the offset for the sums of 3 polynomials for 
>> ML-KEM AArch64 intrinsics with Java and x86_64 intrinsics.  By offsetting by 
>> `2*q` instead of `q`, this fix guarantees that the sum will be greater than 
>> `-q`, which aligns with output ranges [0, q) as commented in methods such as 
>> `mlKemAddPoly()`.  After Barrett reduction, `-q` is reduced out of range to 
>> `q`. 
>> 
>> ---------
>> - [X] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> I'm tempted to set the reviewer count to 1 here as this is a trivial change 
> and clearly makes the intrinsic match the Java code. However, given the 
> security label it might be better to get another review.

Thank you @adinn for your review.  @vpaprotsk, your test suite found this 
discrepancy, could you please review? ;)

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

PR Comment: https://git.openjdk.org/jdk/pull/34178#issuecomment-7362258039

Reply via email to