RFR: 8319716: RISC-V: Add SHA-2 [v2]

Robbin Ehn rehn at openjdk.org
Tue Nov 28 14:20:49 UTC 2023


On Tue, 21 Nov 2023 08:23:25 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> The vsetivli is often expensive:ish,  the code in openssl sets it five times before reaching first round.
>> That don't seem like a good idea, now vsetivli make the code much easier to read yes...
>> 
>> I guess I need to check numbers for that also.. :)
>
> Yeah. Why not consider something more simpler if there is no known big difference on performance numbers? And this is the first version when RVV-1.0 compatible hardwares are not popular yet :-)

Not yet addressed.

>> 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` (for the embeded) or RVV (as in our case) will do.
> So we might want to do this check: `if (UseRVV && UseZvkn)`.
> 
> (Or making enablement of `UseZvkn` dependent of `UseRVV`? Then only check one option `UseZvkn` here)

Please add new comments in updated code.

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

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


More information about the hotspot-dev mailing list