On Mon, 6 Oct 2025 17:56:59 GMT, Valerie Peng <[email protected]> wrote:

>> src/java.base/share/classes/javax/crypto/Cipher.java line 329:
>> 
>>> 327:                     SHA512TRUNCATED.length());
>>> 328:             sha512SlashIdx = (sha512Idx != -1 ? sha512Idx + 3 : -2);
>>> 329:         }
>> 
>> The logic is quite complex. Can you create a dedicated method for it like 
>> `indexOfRealSlashIn(String s)`?
>> 
>> We can even call it on the mode part.
>
> There are quite a few values being updated here, that's why I didn't make it 
> into a method initially. Let me think about it more...

Both `sha512Idx` and `sha512SlashIdx` locally assigned, `SHA512TRUNCATED` is a 
constant, `transformation` is not mutated.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27615#discussion_r2408217227

Reply via email to