RFR: 8298390: Implementing ML-KEM key encapsulation mechanism [v15]

Kevin Driver kdriver at openjdk.org
Thu Nov 7 17:30:47 UTC 2024


On Thu, 7 Nov 2024 00:47:33 GMT, Ben Perez <bperez at openjdk.org> wrote:

>> Java implementation of ML-KEM, the [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final) post-quantum KEM scheme. Depends on https://github.com/openjdk/jdk/pull/21167
>
> Ben Perez has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - default random for encaps, supported alg in SunJCE
>  - copyright header

src/java.base/share/classes/com/sun/crypto/provider/ML_KEM_Provider.java line 129:

> 127:         @Override
> 128:         public byte[][] implEncapsulate(String name, byte[] encapsulationKey, Object ek, SecureRandom secureRandom) {
> 129:             byte[] randomBytes = new byte[32];

Constant for `32`?

src/java.base/share/classes/com/sun/crypto/provider/ML_KEM_Provider.java line 159:

> 157:                     new ML_KEM.ML_KEM_DecapsulationKey(decapsulationKey), kpkeCipherText);
> 158:             } catch (NoSuchAlgorithmException | InvalidKeyException | DecapsulateException e) {
> 159:                 throw new RuntimeException(e); // should not happen

Consider `ProviderException`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21478#discussion_r1833097009
PR Review Comment: https://git.openjdk.org/jdk/pull/21478#discussion_r1833098015


More information about the security-dev mailing list