RFR: 8325448: Hybrid Public Key Encryption [v10]

Sean Mullan mullan at openjdk.org
Thu Mar 13 14:00:06 UTC 2025


On Wed, 12 Mar 2025 12:18:22 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Implement HPKE as defined in https://datatracker.ietf.org/doc/rfc9180/.
>> ![HPKEParameterSpec](https://github.com/user-attachments/assets/4a7e6609-fd64-444a-978f-bde1634caa70)
>
> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   switch to Asserts.assertThrows in test; use traditional javadoc style

Some initial comments.

src/java.base/share/classes/javax/crypto/spec/HPKEParameterSpec.java line 55:

> 53:  * provided to {@code init()}.
> 54:  * <li> {@link #of(int, int)} creates an instance with explicitly specified
> 55:  * KDF, and AEAD algorithm identifiers, but the KEM algorithm identifier will be

No comma necessary after "KDF".

src/java.base/share/classes/javax/crypto/spec/HPKEParameterSpec.java line 55:

> 53:  * provided to {@code init()}.
> 54:  * <li> {@link #of(int, int)} creates an instance with explicitly specified
> 55:  * KDF, and AEAD algorithm identifiers, but the KEM algorithm identifier will be

I'd suggest breaking this into two sentences, remove the ", but" from the first sentence, and start the second sentence as "The KEM algorithm identifier ..."

src/java.base/share/classes/javax/crypto/spec/HPKEParameterSpec.java line 65:

> 63:  * defined in <a href="https://www.rfc-editor.org/rfc/rfc9180.html#section-7">Section 7</a>
> 64:  * of RFC 9180 and the
> 65:  * <a href="https://www.iana.org/assignments/hpke/hpke.xhtml">IANA HPKE page</a>.

I think it would be useful to mention here that there are constants defined for the standard algorithms. My initial reading of this, I thought I would have to lookup the hex values and convert them to integers to use the API.

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

PR Review: https://git.openjdk.org/jdk/pull/18411#pullrequestreview-2679715999
PR Review Comment: https://git.openjdk.org/jdk/pull/18411#discussion_r1992201674
PR Review Comment: https://git.openjdk.org/jdk/pull/18411#discussion_r1992206217
PR Review Comment: https://git.openjdk.org/jdk/pull/18411#discussion_r1993585316


More information about the security-dev mailing list