Skip to content

Enable and use ML-KEM by default#9732

Draft
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:pqc_first
Draft

Enable and use ML-KEM by default#9732
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:pqc_first

Conversation

@Frauschi
Copy link
Contributor

@Frauschi Frauschi commented Feb 2, 2026

This PR changes the following:

  • Enable ML-KEM by default
  • Only allow three to-be-standardized hybrid PQ/T combinations by default (SECP256R1MLKEM768, X25519MLKEM768, SECP384R1MLKEM1024).
  • Use X25519MLKEM768 as the default KeyShare in the ClientHello (if user does not override that) if Curve25519 is enabled. Otherwise, use SECP384MLKEM1024 or SECP256MLKEM768.
  • Disable standalone ML-KEM in supported groups by default (enable with --enable-tls-mlkem-standalone)
  • Disable extra OQS-based hybrid PQ/T curves by default and gate behind --enable-experimental (enable with --enable-extra-pqc-hybrids)
  • Reorder the SupportedGroups extension to reflect the preferences
  • Reorder the preferredGroup array to also reflect the same preferences

This also reflects the same behavior as OpenSSL has since version 3.5.

Currently a draft, as some tests regarding DTLS 1.3 and fragmentation fail.

@Frauschi Frauschi requested review from anhu, dgarske and douzzer February 2, 2026 16:10
@Frauschi Frauschi force-pushed the pqc_first branch 10 times, most recently from cb08c65 to 0040099 Compare February 4, 2026 14:45
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is unhappy with some of the implicit casts I think:

                 from wolfcrypt/src/wc_mlkem.c:66:
wolfcrypt/src/wc_mlkem.c: In function 'wc_MlKemKey_MakeKeyWithRandom':
wolfcrypt/src/wc_mlkem.c:519:53: error: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Werror=sign-conversion]
  519 |         e = (sword16*)XMALLOC((k + 1) * k * MLKEM_N * sizeof(sword16),
      |                                                     ^
./wolfssl/wolfcrypt/types.h:790:33: note: in definition of macro 'XMALLOC'
  790 |                 wolfSSL_Malloc((s)))
      |                                 ^
wolfcrypt/src/wc_mlkem.c:560:22: error: conversion from 'int' to 'byte' {aka 'unsigned char'} may change value [-Werror=conversion]
  560 |             buf[0] = k;
      |                      ^
wolfcrypt/src/wc_mlkem.c: In function 'mlkemkey_encapsulate':
wolfcrypt/src/wc_mlkem.c:852:42: error: conversion to 'int' from 'unsigned int' may change the sign of the result [-Werror=sign-conversion]
  852 |         ret = mlkem_get_noise(&key->prf, k, y, e1, e2, r);
      |                                          ^

@Frauschi
Copy link
Contributor Author

Frauschi commented Feb 5, 2026

CI is unhappy with some of the implicit casts I think:

Yeah I already talked to @SparkiDev about these and I still have to fix them (trying to fix the other failing tests first). The ML-KEM source files haven't yet been under test with these conversion checks.

@Frauschi Frauschi force-pushed the pqc_first branch 7 times, most recently from e33882d to 6bd2639 Compare February 6, 2026 16:28
* Enable ML-KEM by default
* Only allow three to-be-standardized hybrid PQ/T combinatations by
  default
* Use X25519MLKEM768 as the default KeyShare in the ClientHello (if user
  does not override that)
* Disable standalone ML-KEM in supported groups by default (enable with
  --enable-tls-mlkem-standalone)
* Disable extra OQS-based hybrid PQ/T curves by default and gate
  behind --enable-experimental (enable with --enable-extra-pqc-hybrids)
* Reorder the SupportedGroups extension to reflect the preferences
* Reorder the preferredGroup array to also reflect the same preferences
* Enable DTLS1.3 ClientHello fragmentation by default when both DTLS1.3
  and ML-KEM are enabled
* Fix memory leak in TLS server PQC handling in case of ECH
* Ensure PQ/T hybrids are properly tested in unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants