On Wed, 26 Apr 2023 19:02:53 GMT, Weijun Wang <wei...@openjdk.org> wrote:

>> The KEM API and DHKEM impl. Note that this PR uses new methods in 
>> https://github.com/openjdk/jdk/pull/13250.
>
> Weijun Wang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   no more pk/sk, AIOOBE to IOOBE

src/java.base/share/classes/javax/crypto/KEM.java line 606:

> 604:      * @param publicKey the receiver's public key, must not be {@code 
> null}
> 605:      * @return the encapsulator for this key
> 606:      * @throws InvalidKeyException if {@code publicKey} is invalid

What about throwing `NullPointerException` if `publicKey` is `null`? In this 
case a `RuntimeException` seems more appropriate, and throwing NPE seems more 
consistent with how you treat `null` parameters of other methods.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13256#discussion_r1178356851

Reply via email to