RFR: 8334999: RISC-V: implement AES single block encryption/decryption intrinsics [v3]

ArsenyBochkarev duke at openjdk.org
Sun Sep 8 13:24:49 UTC 2024


On Thu, 18 Jul 2024 08:26:02 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Changes requested by fyang (Reviewer).
>
>> As for comparison with the openssl version: first of all, thanks for the sources, @RealFYang! The main difference that I see is that they introduced three different different versions of encryption depending on the key sizes, which allows them to skip a couple of instructions, like when I did `vaesem_vv(res, vzero)` followed by `vxor_vv(res, res, vtemp1)`. So I thought it'll be more efficient to replace the current version by something openssl-lookalike. The only problem I see is increasing code size a bit. Please let me know if we are not interested in this change for some reason
> 
> Does `vaesz_vs` help in anyway? And what about the `generate_aescrypt_decryptBlock`?  [1]
> 
> [1] https://github.com/openssl/openssl/blob/master/crypto/aes/asm/aes-riscv64-zvkned.pl#L451

Hello @RealFYang! Sorry for such a late reply.
> Does `vaesz_vs` help in anyway?

As far as I know, the `vaesz_vs` instruction is just an alias for `vxor`, so it was already utilized in this patch.

> `generate_aescrypt_decryptBlock`

I missed this case in initial multiversioning commit, so I multiversioned the decrypt intrisic also, thanks for pointing it out!

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

PR Comment: https://git.openjdk.org/jdk/pull/19960#issuecomment-2336684717


More information about the hotspot-dev mailing list