RFR: 8365732: RISC-V: implement AES CTR intrinsics [v29]

Hamlin Li mli at openjdk.org
Wed Dec 3 09:23:01 UTC 2025


On Wed, 3 Dec 2025 03:20:34 GMT, Anjian Wen <wenanjian at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2636:
>> 
>>> 2634:   void counterMode_AESCrypt(int round, Register in, Register out, Register key, Register counter,
>>> 2635:                             Register input_len,  Register saved_encrypted_ctr, Register used_ptr) {
>>> 2636:     // Algorithm:
>> 
>> This should be my last comment :)
>> Where is this "Algorithm" from? Can you put a link here?
>
> Oh sure, when implementing the Algorithm, I mainly referred to the Java code implementation (https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java#L200-L212). besides, I referred to the aarch64 implementation (https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp#L3190), and made some modifications for RISC-V instructions

Thanks!
If this C style code is based on the java one, can you add a reference here to the java code?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25281#discussion_r2584282181


More information about the hotspot-compiler-dev mailing list