Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Vendor: Google · https://go.dev/ · pkg:golang/stdlib · Last reviewed 2026-12-05 · History

Summary

  • Statically linked Go programs, including the GitHub CLI, take TLS from crypto/tls, so the Go version in the program’s go.mod (not only the build toolchain) decides support.1
  • TLS 1.3 key agreement: the hybrid group X25519MLKEM768 is default from Go 1.24; SecP256r1MLKEM768 and SecP384r1MLKEM1024 are default from Go 1.26.23
  • ML-DSA signatures in TLS 1.3 are available from Go 1.27; crypto/mlkem from 1.24, crypto/mldsa from 1.27.24
  • Classical groups can be disabled by the program’s author with Config.CurvePreferences; a user of a compiled program cannot unless the program exposes a setting.5
  • SSH (golang.org/x/crypto/ssh): hybrid mlkem768x25519-sha256 is first in the default key exchange list.6

To drop classical groups, set Config.CurvePreferences to only tls.X25519MLKEM768, tls.SecP256r1MLKEM768 and tls.SecP384r1MLKEM1024.5

Cryptographic operations

  • TLS key agreement: client or server; with empty Config.CurvePreferences the default set applies: “From Go 1.24, the default includes the X25519MLKEM768 hybrid post-quantum key exchange. To disable it, set CurvePreferences explicitly or use the GODEBUG=tlsmlkem=0 environment variable.”5
  • Go 1.26 adds the two NIST-curve hybrids to the default.3 Go 1.27 supports pure MLKEM1024, not default: “It can be enabled by adding it to Config.CurvePreferences.”4 X25519, P-256, P-384 and P-521 stay supported.5
  • TLS authentication: Go 1.27 “crypto/tls now supports ML-DSA signatures in TLS 1.3, with the new MLDSA44, MLDSA65, and MLDSA87 SignatureScheme values” and “crypto/x509 now supports ML-DSA private keys, public keys, and signatures”; a server needs an ML-DSA certificate. Earlier it is classical.4
  • Primitives: crypto/mlkem ML-KEM-768 and ML-KEM-1024 (1.24);2 crypto/hpke HPKE (RFC 9180) “including support for post-quantum hybrid KEMs” (1.26);3 crypto/mldsa ML-DSA, FIPS 204 (1.27).4
  • SSH: golang.org/x/crypto/ssh is a separate module; its default key exchange list starts with mlkem768x25519-sha256 followed by classical algorithms, “supported from Go 1.24”.6 Main added ML-DSA key algorithms and the composite ssh-mldsa44-ed25519, the latter committed 2026-12-04; which tagged release contains them was not confirmed (checked 2026-12-05).7

Versions

Change Version Date Package URL Source
Pre-standard X25519Kyber768Draft00 default in crypto/tls 1.23 2024-08-13 pkg:golang/stdlib@v1.23.0 8
X25519MLKEM768 default; Kyber draft removed; crypto/mlkem added 1.24 2025-02-11 pkg:golang/stdlib@v1.24.0 2
SecP256r1MLKEM768 and SecP384r1MLKEM1024 default; crypto/hpke added 1.26 2026-02-10 pkg:golang/stdlib@v1.26.0 3
ML-DSA in crypto/tls and crypto/x509; crypto/mldsa added; MLKEM1024 available 1.27 2026-08-19 pkg:golang/stdlib@v1.27.0 4

Release dates are from the Go release history.9

Configuration

Enabling PQC

  • None from Go 1.24 if the program does not set CurvePreferences and its go.mod declares Go 1.24 or later; defaults are “the defaults for the Go toolchain used to build the program, amended to match the Go version listed in go.mod”, so a new toolchain with an older go.mod keeps older defaults.1
  • A program that sets CurvePreferences must add the hybrid itself:
cfg := &tls.Config{
	CurvePreferences: []tls.CurveID{tls.X25519MLKEM768, tls.X25519},
}

Disabling classical algorithms

cfg := &tls.Config{
	CurvePreferences: []tls.CurveID{
		tls.X25519MLKEM768,
		tls.SecP256r1MLKEM768,
		tls.SecP384r1MLKEM1024,
	},
}
  • A peer supporting none fails the handshake. No environment variable removes classical groups; GODEBUG only goes the other way.

Turning the hybrid groups off

  • GODEBUG=tlsmlkem=0 removes X25519MLKEM768 from the default set, GODEBUG=tlssecpmlkem=0 the two NIST-curve hybrids.23
  • Reason given: “buggy TLS servers that do not handle large records correctly, causing a timeout during the handshake”.2
  • From Go 1.27 these apply only to the default set; groups listed in CurvePreferences stay enabled.4

Proofs

References

  1. Go, GODEBUG and Go version defaults, “Default GODEBUG Values”. https://go.dev/doc/godebug (accessed 2026-12-05) ↩ ↩2

  2. Go 1.24 release notes, crypto/mlkem and crypto/tls. https://go.dev/doc/go1.24 (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  3. Go 1.26 release notes, crypto/hpke and crypto/tls. https://go.dev/doc/go1.26 (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 ↩5

  4. Go 1.27 release notes, crypto/mldsa and crypto/tls. https://go.dev/doc/go1.27 (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  5. Package crypto/tls documentation, Config.CurvePreferences and CurveID. https://pkg.go.dev/crypto/tls#Config (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4

  6. golang.org/x/crypto, ssh/common.go at commit 988db5b. https://github.com/golang/crypto/blob/988db5b9fb6ef97414c924ef49936378bcf0ca9c/ssh/common.go#L61-L107 (accessed 2026-12-05) ↩ ↩2

  7. golang.org/x/crypto, commit 61d33f3, “ssh: add the ssh-mldsa44-ed25519 composite algorithm”. https://github.com/golang/crypto/commit/61d33f31e2ca (accessed 2026-12-05) ↩

  8. Go 1.23 release notes, crypto/tls. https://go.dev/doc/go1.23 (accessed 2026-12-05) ↩

  9. Go release history. https://go.dev/doc/devel/release (accessed 2026-12-05) ↩


Edit: Go

If you give an email address it is recorded publicly as the author of the commit, and GitHub will link the commit to your account if that address belongs to one.

Edits are reviewed before they appear. By submitting you release your contribution under CC BY-SA 4.0. Read the editorial guidelines first.

This site uses Just the Docs, a documentation theme for Jekyll.