On Wed, 1 Apr 2026 20:33:18 GMT, Weijun Wang <[email protected]> wrote:

>> src/java.base/share/classes/javax/crypto/Cipher.java line 2646:
>> 
>>> 2644:      *          (must be greater than 0)
>>> 2645:      *
>>> 2646:      * @return the derived data
>> 
>> Is this a new array/clone or not?
>
> It's definitely a new copy. I never thought about mentioning if it's a copy 
> because it's always calculated on-demand. It's not a state that was stored 
> there for later retrieval.
> 
> `KDF::deriveData` and `ExtendedSSLSession::exportKeyingMaterialData` haven't 
> mentioned it. `KeyAgreement::generateSecret` says `@return the new buffer 
> with the shared secret` that implies it's a new array.

I've modified it into `@return a new array containing the derived data`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18409#discussion_r3024613766

Reply via email to