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

Fei Yang fyang at openjdk.org
Tue Oct 29 12:16:08 UTC 2024


On Mon, 28 Oct 2024 20:49:18 GMT, Arseny Bochkarev <duke at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2283:
>> 
>>> 2281:     for (int i = 0; i < rounds; i++) {
>>> 2282:       __ vle32_v(working_vregs[i], key);
>>> 2283:       __ vrev8_v(working_vregs[i], working_vregs[i]);
>> 
>> What's is this `vrev8_v` for? I wonder how this maps to the code-samples at [1]. Might deserve a code comment here. 
>> 
>> [1] https://github.com/riscv/riscv-crypto/blob/main/doc/vector/code-samples/zvkned.s
>
> I'm not very familiar with OpenSSL but I guess it is just uses different endianness when storing the result :shrug:  (compared to [big-endian](https://docs.oracle.com/javase/specs/jvms/se23/html/jvms-2.html#jvms-2.11) JVM). I'll left the note on it in the code

Hmm ... I didn't find a direct evidence about the endianness of the key required here. Was is documented anywhere? I prefer to add some more details in the code comment to make it more readable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19960#discussion_r1820683443


More information about the hotspot-dev mailing list