Skip to content

Conversation

@Geun-Oh
Copy link

@Geun-Oh Geun-Oh commented Jan 2, 2026

Description

This PR adds automatic support for post-quantum hybrid key exchange (X25519MLKEM768) introduced in Go 1.24.0. When curve_preferences is not explicitly configured in TLS settings, the collector now automatically prioritizes X25519MLKEM768 for optimal security in non-FIPS builds compiled with Go 1.24+.

Key changes:

  • Non-FIPS builds with Go 1.24+ automatically default to [X25519MLKEM768, X25519, P256, P384, P521] curve preferences
  • FIPS builds continue to use only NIST P-curves [P256, P384, P521] (FIPS-compliant)
  • Backward compatibility maintained for Go versions before 1.24.0 using constant 0x11EC
  • Build tag-based separation between FIPS (curves_fips.go) and non-FIPS (curves_nofips.go) implementations

This enables post-quantum security by default without requiring any configuration changes, while maintaining full backward compatibility and FIPS compliance.

Link to tracking issue

Fixes #14335

Testing

  • Added unit tests for default curve preferences (TestDefaultCurvePreferences)
  • Added Go 1.24+ validation test (TestX25519MLKEM768Value) to ensure constant 0x11EC matches tls.X25519MLKEM768
  • Updated existing curve preference tests to handle X25519MLKEM768
  • Verified FIPS and non-FIPS builds compile and test correctly
  • Confirmed backward compatibility with Go versions before 1.24.0

All tests pass for both FIPS and non-FIPS build configurations.

Documentation

  • Updated README.md to document automatic post-quantum security when curve_preferences is not configured
  • Added explanation of X25519MLKEM768 and its post-quantum hybrid key exchange capabilities
  • Documented default curve preference order for both FIPS and non-FIPS builds
  • Added examples showing how to explicitly configure X25519MLKEM768 if desired

@Geun-Oh Geun-Oh requested a review from a team as a code owner January 2, 2026 05:29
@Geun-Oh Geun-Oh requested a review from axw January 2, 2026 05:29
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 2, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

"P521": tls.CurveP521,
"X25519": tls.X25519,
"X25519MLKEM768": tls.X25519MLKEM768,
"X25519MLKEM768": X25519MLKEM768,

Choose a reason for hiding this comment

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

Why are you breaking convention?


// defaultCurvePreferences defines the default order of curve preferences for FIPS builds.
// Only NIST P-curves are available in FIPS mode.
var defaultCurvePreferences = []tls.CurveID{
Copy link
Contributor

Choose a reason for hiding this comment

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

that's the same set as tlsCurveTypes right above

@atoulme
Copy link
Contributor

atoulme commented Jan 2, 2026

There is no need to specify go versions, we only support supported Go versions, and 1.24 is the oldstable version now.

I don't understand why you're making those changes as this is doable right now by way of configuration. Why should X25519MLKEM768 be offered always? Can you reduce your diff to avoid touching anything related to FIPS?

@Brent-Durham
Copy link

Brent-Durham commented Jan 3, 2026 via email

@Geun-Oh
Copy link
Author

Geun-Oh commented Jan 3, 2026

Agree with that. So It means that it's okay to done with avoid double checking..?

It seems that I misunderstood what @Brent-Durham wants.

Maybe it will be good to close this and re-open with new pr if there are remain fixing things.

@Geun-Oh
Copy link
Author

Geun-Oh commented Jan 3, 2026

If X25519MLKEM768 doesn't needed to provided in default, I'll close it and finish this issue.
Or It would be great to add test & docs of X25519MLKEM768?

@atoulme
Copy link
Contributor

atoulme commented Jan 4, 2026

Does it need to be provided by default? Can you make a case for it?

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.

hybrid key exchange (go >= 1.24)

3 participants