RFR: 8365732: RISC-V: implement AES CTR intrinsics [v11]
Andrew Haley
aph at openjdk.org
Mon Oct 20 09:43:06 UTC 2025
On Mon, 20 Oct 2025 09:29:11 GMT, Anjian Wen <wenanjian at openjdk.org> wrote:
>> Your encryption operations should run in constant time.
>
> @theRealAph Sorry, I don't quite understand what the "constant time" here means.
>
> if you mean counter increase, here I try to optimize counter increase with vectorAdd. If N is the number of counter we should increase, it can theoretically optimize the time use from `O(N * 16) `to `O(N * 2 / (4 * (vector_register_len / 64)))`, as for vector_register_len equals 128, it will optimize about 64 times if the N is large enough.
And I don't understand any of that.
You should follow the example of the other implementations of CTR mode in HotSpot, so that no matter what the value of the counter is, incrementing it takes the same time.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25281#discussion_r2444422766
More information about the hotspot-compiler-dev
mailing list