RFR: JDK-8216437 : PPC64: Add intrinsic for GHASH algorithm [v28]

Andrew Haley aph at openjdk.org
Thu Apr 24 10:48:04 UTC 2025


On Thu, 3 Apr 2025 13:40:39 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

>> Hi @theRealAph Do you see a scope to reduce these swaps in the algorithm , for the above mentioned instructions. 
>> I feel there is a similar set of instructions used to perform reduction in 
>> https://www.researchgate.net/publication/285612706_Implementing_GCM_on_ARMv8
>
> Hi @theRealAph   Let me know if you need any additional context or if there’s anything I can do to help with the review.

> Hi @theRealAph Do you see a scope to reduce these swaps in the algorithm , for the above mentioned instructions. I feel there is a similar set of instructions used to perform reduction in https://www.researchgate.net/publication/285612706_Implementing_GCM_on_ARMv8

The logic we use in AArch64 is better.

The paper notes that

_The advantage of [reversing the bytes in the vector, leading to a reversed binary field element, which can be  multiplied by reversing the modular reduction algorithm in the binary field multiplication]  that in most cases it is simpler to reverse the bytes in a vector than reversing the bits in each byte._

This is not true for AArch64, which makes it very easy to reverse the bits in each byte, so we do GHASH in its natural order.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20235#discussion_r2058089810


More information about the hotspot-dev mailing list