Skip to content

[release/11.0] Managed HPKE - #134442

Merged
artl93 merged 1 commit into
dotnet:release/11.0from
bartonjs:port_hpke
Sep 23, 2026
Merged

artl93 merged 1 commit into
dotnet:release/11.0from
bartonjs:port_hpke

Conversation

@bartonjs

@bartonjs bartonjs commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

cherry-pick of 2023ab7 (#133804)

Customer Impact

  • Customer reported
  • Found internally

New API for .NET 11 to support using HPKE as part of the PQC transition effort.

Regression

  • Yes
  • No

Testing

This standalone feature is extensively tested in this PR.

Risk

Low. The feature is entirely isolated, only consumers of these new [Experimental] types are affected.

This change contains the full API set for the feature, but does not represent full functionality (e.g. Win32 interop instead of the managed implementation on Windows), which can be added in servicing.

@bartonjs
bartonjs requested review from artl93 and vcsjones September 22, 2026 18:04
@bartonjs bartonjs self-assigned this Sep 22, 2026
Copilot AI lite review requested due to automatic review settings September 22, 2026 18:04
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 2 Low severity

Open (3)
What changed in this PR

Adds experimental managed HPKE support, including public APIs, managed cryptographic adapters, compatibility packaging, and extensive tests.

Changes:

  • Adds HPKE suite, KEM, KDF, sender, recipient, and key APIs.
  • Implements managed DHKEM, HKDF/SHAKE, AES-GCM, and ChaCha20-Poly1305.
  • Adds test vectors, contract tests, diagnostics, and Microsoft.Bcl.Cryptography integration.

Validation: No build or tests run in this review.

File Description
src/​libraries/​System.Security.Cryptography/​tests/​System.Security.Cryptography.Tests.csproj Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeX25519DiffieHellmanKemAdapter.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeManagedKemAdapter.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeManagedKdfAdapter.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeManagedChaCha20Poly1305AeadAdapter.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeManagedAesAeadAdapter.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeManagedAeadAdapter.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeKemMetadata.Managed.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeKdfMetadata.Managed.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeImplementation.NotSupported.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeImplementation.Managed.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeECDiffieHellmanKemAdapter.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​HpkeAeadMetadata.Managed.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System/​Security/​Cryptography/​FixedMemoryKeyBox.cs Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​System.Security.Cryptography.csproj Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​src/​Resources/​Strings.resx Updated as part of this pull request.
src/​libraries/​System.Security.Cryptography/​ref/​System.Security.Cryptography.cs Updated as part of this pull request.
src/​libraries/​Microsoft.Bcl.Cryptography/​tests/​Microsoft.Bcl.Cryptography.Tests.csproj Updated as part of this pull request.
src/​libraries/​Microsoft.Bcl.Cryptography/​src/​Resources/​Strings.resx Updated as part of this pull request.
src/​libraries/​Microsoft.Bcl.Cryptography/​src/​Microsoft.Bcl.Cryptography.Forwards.cs Updated as part of this pull request.
src/​libraries/​Microsoft.Bcl.Cryptography/​src/​Microsoft.Bcl.Cryptography.csproj Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeTests.cs Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeTestDataTests.cs Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeTestData.cs Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeSuiteTests.cs Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeSenderContractTests.cs Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeRecipientContractTests.cs Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeNotSupportedTests.cs Updated as part of this pull request.
src/​libraries/​Common/​tests/​System/​Security/​Cryptography/​HpkeKeyTests.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeSuite.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeSender.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeRecipient.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeKemMetadata.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeKem.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeKdfMetadata.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeKdf.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeAeadMetadata.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Security/​Cryptography/​HpkeAead.cs Updated as part of this pull request.
src/​libraries/​Common/​src/​System/​Experimentals.cs Updated as part of this pull request.
docs/​project/​list-of-diagnostics.md Updated as part of this pull request.

case HpkeKem.MLKEM1024_P384:
return false;
default:
Debug.Fail($"Kem ${Kem}'s support is unknown.");

@artl93 artl93 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

M2 (non-tactics) approved.

@artl93 artl93 added the Servicing-consider Issue for next servicing release review label Sep 22, 2026
@bartonjs bartonjs added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 22, 2026
@bartonjs

Copy link
Copy Markdown
Member Author

Approved via email

@artl93

artl93 commented Sep 22, 2026 via email •

Copy link
Copy Markdown
Member

@bartonjs

Copy link
Copy Markdown
Member Author

/ba-g #134367

@artl93
artl93 merged commit d5ff400 into dotnet:release/11.0 Sep 23, 2026
103 of 108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Security Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants