[release-branch.go1.27] Honor the testing random reader in ML-KEM - #2501
Merged
George Adams (gdams) merged 1 commit intoSep 8, 2026
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change is narrowly scoped, aligns with the stated intent (public crypto/rand.Reader default-reader checks), and updates dependency rules to match.
Review tier: Lite
Findings: None
What changed in this PR
Backports the Go 1.27 ML-KEM “use public crypto/rand.Reader for default-reader checks” fix into the existing crypto-backend patch, preventing backend ML-KEM keygen/encapsulation from running when testing/cryptotest.SetGlobalRandom has overridden crypto/rand.Reader (fixing deterministic TLS ClientHello replay mismatches).
Changes:
- Update
crypto/mlkembackend gating to userand.IsDefaultReader(crypto/rand.Reader)rather thancrypto/internal/rand.Reader. - Adjust
go/build/deps_test.godependency rules to reflectcrypto/mlkem’s dependency oncrypto/rand.Reader.
Patches are happy!
| File | Description |
|---|---|
| patches/0002-Add-crypto-backends.patch | Backports ML-KEM reader-guard logic and updates deps rules for crypto/mlkem accordingly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
George Adams (gdams)
approved these changes
Sep 8, 2026
George Adams (gdams)
enabled auto-merge (squash)
September 8, 2026 08:24
George Adams (gdams)
merged commit Sep 8, 2026
cbbd831
into
microsoft/release-branch.go1.27
57 checks passed
George Adams (gdams)
deleted the
dev/qmuntal/backport-mlkem-random-go1.27
branch
September 8, 2026 09:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport the ML-KEM portion of main commit 93114c97deb03b0b112dc52d99e326661a2ba1a7 plus the dependency rule fix 29c2d8ac76.
crypto/internal/rand.Readerremains the default undertesting/cryptotest.SetGlobalRandom, so check the publiccrypto/rand.Reader. This fixes deterministic TLS ClientHello ML-KEM replay mismatches without changing fixtures.Changes
1.27 public-reader guards for 768/1024 and dependency updates in existing patch 0002.
Validation
Windows/arm64 CNG, existing
TestSetGlobalRandom/mlkem.GenerateKey768passed, ML-KEM tests/dependencyTestDependenciespassed, temporary 768/1024 deterministic/roundtrip/key-lifetime probes passed and were removed,MS_GO_NOSYSTEMCRYPTO=1control passed, andgit go-patch extractverified. One combined 1.26 run timed out; isolated checks/bounded reruns passed. No TLS replay/E2E suites were run.The Go 1.26 toolchain was built from patched Go 1.26.8 source; the existing local devel toolchain was used against patched 1.27.1 source.