Repository navigation
[release-branch.go1.26] Honor the testing random reader in ML-KEM - #2656
George Adams (gdams) merged 1 commit into
Conversation
Restore the unmerged backport from #2502 (e027b6b), refreshed against the current release patch stack. Gate ML-KEM constructors on the public random reader, keep methods dispatching through each key's stored implementation, and update the dependency rule for crypto/rand. Regenerate the integration patch and index with git-go-patch. Co-authored-by: qmuntal <quimmuntal@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Stack is now wired:
Both platform branches have been rebased onto this fix, and pipeline-generation tests pass on each. Merge this prerequisite first, then retarget the two platform PRs to the release branch. Both original CI failures were the same ML-KEM deterministic-randomness assertion. |
8d6902a to
77ebb40
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The PR description still treats the included Intel Darwin macOS 26 migration as a separate stacked change, leaving its scope and validation summary inaccurate.
No open issues 🎉
What changed in this PR
Restores the Go 1.26 ML-KEM randomness fix so seeded testing readers are honored and keys remain usable across reader changes. The diff also includes the Intel macOS hosted-agent migration from #2650.
Changes:
- Gate native ML-KEM constructors on the public random reader and dispatch key methods by their stored implementation.
- Update crypto dependency rules and regenerate the integration patch metadata.
- Switch Intel Darwin agents to macOS 26 and update the hosted-image documentation link, leaving ARM64 unchanged.
| File | Description |
|---|---|
| patches/index.json | Refreshes the integration patch checksum and index entries. |
| patches/0004-Use-crypto-backends.patch | Updates ML-KEM dispatch and crypto dependency rules. |
| eng/pipeline/stages/pool-2.yml | Moves Intel Darwin agents to macOS 26 and updates the documentation link. |
Review effort: Balanced
|
Correction: I caused #2649 and #2650 to auto-merge by changing their base while their existing auto-merge settings were enabled. That was my mistake, not a manual merge by the user. Restored this branch to the original tested ML-KEM-only commit Replacement stacked PRs, all with auto-merge disabled:
Merge this fix into the release branch first, then retarget the two children to the release branch and merge them separately. Do not merge the children into this branch. |
75e2e5f
into
microsoft/release-branch.go1.26
Summary
Fresh replacement for closed, unmerged #2502, restoring its ML-KEM randomness fix against the current Go 1.26 release patch stack. The equivalent Go 1.27 fix was merged in #2501.
crypto/rand.Readerbefore routing ML-KEM-768/1024 constructors to a native backend.testing/cryptotest.SetGlobalRandomreplaces that reader, but the internal reader remains the default.Why
Both the Windows Server 2025 tests in #2649 and Intel macOS 26 tests in #2650 fail
testing/cryptotest/TestSetGlobalRandom/mlkem.GenerateKey768: native ML-KEM generation bypasses the seeded Go RNG. This PR contains only the ML-KEM fix and generated patch metadata. It is the bottom layer of native stack #2659: #2656 → #2658 (Windows Server 2025) → #2657 (Intel macOS 26), landing onmicrosoft/release-branch.go1.26. Use GitHub’s native stack merge flow; GitHub updates remaining PR bases as lower layers land. No manual retargeting is needed, and auto-merge is disabled.Validation
TestSetGlobalRandom, ML-KEM roundtrip/bad-length/accumulated/size tests, andgo/build.TestDependencies.GOEXPERIMENT=nosystemcrypto) controls passed.git go-patch extract; patch extraction succeeds and actual source whitespace checks pass.