On Fri, 11 Apr 2025 18:35:07 GMT, Sean Mullan <mul...@openjdk.org> wrote:

>> Weijun Wang has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - put encapsulation in params from getParameters
>>  - receiver must specify all algorithm identifiers
>
> src/java.base/share/classes/javax/crypto/spec/HPKEParameterSpec.java line 53:
> 
>> 51:  * <li> {@link #of()} creates an instance with unspecified KEM, KDF, and 
>> AEAD
>> 52:  * algorithms, which will be determined by the implementation based on 
>> the key
>> 53:  * provided to {@code init()}. This instance can only be used by the 
>> sender.
> 
> Does `Cipher.init` throw an exception if the parameters created by 
> `HPKEParameterSpec.of()` are initialized with a cipher in decrypt mode?

Yes, an `InvalidAlgorithmParameterException` is thrown.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18411#discussion_r2052418781

Reply via email to