On Sun, 11 Oct 2026 07:03:57 GMT, Shawn Emery <[email protected]> wrote:

>> Currently, P-384 field operations use 14x28-bit limbs. The efficiency of 
>> these operations vastly improve by using a 7x55-bit limb configuration.  
>> Performance gains yield 32% to 52% for Java alone:
>> 
>> AArch64:
>> Key pair generation - P-384: +51%
>> Key agreement - P-384: +51%
>> 
>> Key pair generation - secP384r1MLKEM1024: +50%
>> KEM  decapsulation - secP384r1MLKEM1024: +49%
>> KEM encapsulation - secP384r1MLKEM1024: +52%
>> 
>> x86_64:
>> Key pair generation - P-384: +35%
>> Key agreement - P-384: +35%
>> 
>> Key pair generation - secP384r1MLKEM1024: +32%
>> KEM  decapsulation - secP384r1MLKEM1024: +32%
>> KEM encapsulation - secP384r1MLKEM1024: +33%
>> 
>> ---------
>> - [X] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Shawn Emery has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Improve x86_64 performance by 13%

OK, I did more fuzz testing.. instrumented your code to throw exceptions if 
there were 'internal carries' that then went away "accidentally"::

        // Reduce lower limbs
        carryReduce(r, c0, c1, c2, c3, c4, c5, c6);

        if (0 !=(r[6]+ CARRY_ADD) >> BITS_PER_LIMB) {
            throw new RuntimeException("carry is not zero! " + (r[6] >> 
BITS_PER_LIMB));
        }


And the math reasoning you gave me computes. My paranoia sufficiently sated, 
approving :)

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

Marked as reviewed by vpaprotski (Committer).

PR Review: https://git.openjdk.org/jdk/pull/33193#pullrequestreview-5604004199

Reply via email to