RFR: 8288047: Accelerate Poly1305 on x86_64 using AVX512 instructions [v5]
vpaprotsk
duke at openjdk.org
Fri Oct 28 21:06:23 UTC 2022
On Fri, 28 Oct 2022 19:46:33 GMT, vpaprotsk <duke at openjdk.org> wrote:
>> src/java.base/share/classes/com/sun/crypto/provider/Poly1305.java line 175:
>>
>>> 173: // Choice of 1024 is arbitrary, need enough data blocks to amortize conversion overhead
>>> 174: // and not affect platforms without intrinsic support
>>> 175: int blockMultipleLength = (len/BLOCK_LENGTH) * BLOCK_LENGTH;
>>
>> Since Poly processes 16 byte chunks, a strength reduced version of above expression could be len & (~(BLOCK_LEN-1)
>
> I guess I got no issue with either version.. I was mostly thinking about code clarity? I think your version is 'more reliable' so just gonna switch it, thanks.
done
-------------
PR: https://git.openjdk.org/jdk/pull/10582
More information about the security-dev
mailing list