RFR: 8319716: RISC-V: Add SHA-2

Fei Yang fyang at openjdk.org
Tue Nov 14 13:51:32 UTC 2023


On Tue, 14 Nov 2023 10:37:31 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/vm_version_riscv.cpp line 160:
>> 
>>> 158:   }
>>> 159: 
>>> 160:   if (UseZvknha && UseZvkb) {
>> 
>> A simple question here: Does the existence of `Zvknhb` also means availability of `Zvknha`? Or should this be something like `if ((UseZvknha || UseZvknhb) && UseZvkb)`?
>
> It seems like the correct answer is:
> `• Zvknhb supports SHA-256 and SHA-512.`
> 
> I suggest we start with supporting Zvkn, which is:
> Zvkned, Zvknhb, Zvkb, Zvkt
> They require: Zve64x
> 
> If someone have a CPU lacking something we can revisit it.
> 
> (I *think* Zvknha is mainly for 32-bits, as it only require sew 32)

Yeah, I agree it's more reasonable to check for `Zvkn` here which stands for NIST Algorithm Suite.
I see the vector cryptography spec says:

The Zvknhb and Zvbc Vector Crypto Extensions --and accordingly the composite extensions Zvkn
and Zvks-- require a Zve64x base, or application ("V") base Vector Extension.

My understanding is that either `Zve64x` or RVV for our case will do.
So we might want to do this check: `if (UseRVV && UseZvkn)`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16562#discussion_r1392608753


More information about the hotspot-dev mailing list