RFR: 8365732: RISC-V: implement AES CTR intrinsics [v11]
    Anjian Wen 
    wenanjian at openjdk.org
       
    Mon Oct 20 09:32:05 UTC 2025
    
    
  
On Mon, 20 Oct 2025 08:43:58 GMT, Andrew Haley <aph at openjdk.org> wrote:
>>> Are you sure this is correct? See `com.sun.crypto.provider.CounterMode::increment`.
>> 
>> Hi @theRealAph , according to your advice and code from `com.sun.crypto.provider.CounterMode::increment`,  I have modified my patch about counter increase by increasing 2 8Byte. Most of case increasing the first 8 Byte(from 8bit to 15 bit) is enough, it only needs to increase the next 8Byte when the first 8Byte overflows. And I have added a test for limit case, could you please help review again?
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25281#discussion_r2444374228
    
    
More information about the hotspot-compiler-dev
mailing list