Repository navigation
KEM support for EnvelopedCms #133046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
KEM support for EnvelopedCms #133046
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7383234
Add ML-KEM EnvelopedCms API surface
vcsjones 87e2c29
Add managed KEM recipient decoding
vcsjones 0fe6aab
Implement ML-KEM decryption
vcsjones 4d76327
Add more test documents
vcsjones a99a998
Expand ML-KEM decryption tests
vcsjones 4db7523
Support certificate-backed ML-KEM decryption
vcsjones fa99155
Implement managed ML-KEM encryption
vcsjones 4a3cadd
Harden ML-KEM EnvelopedCms handling
vcsjones 3a6ef34
Refactor managed KEM decryption dispatch
vcsjones 72f2365
Expand ML-KEM EnvelopedCms coverage
vcsjones 87df405
Expand ML-KEM EnvelopedCms edge-case coverage
vcsjones aed5ccd
Add platform guard
vcsjones b15f9cb
Refine KEM helpers and decode coverage
vcsjones 0b2926a
Test custom and unsupported ML-KEM implementations
vcsjones f88b21c
Merge remote-tracking branch 'ms/main' into ml-kem-enveloped-cms-managed
vcsjones df48d79
First code review feedback round
vcsjones 7e78b81
Change union to be RSA
vcsjones 560c9fb
Rename files
vcsjones 4251ce0
More code review feedback
vcsjones 36f9010
Use CoreLib's source directly
vcsjones 6db3738
More code review feedback
vcsjones c72fa9e
Shim CryptographicOperations
vcsjones 7f59dc4
Test RSA can decrypt with a KEM recipient
vcsjones 2e725d1
Assert version
vcsjones File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
25 changes: 25 additions & 0 deletions
25
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/EnvelopedCmsKey.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Security.Cryptography; | ||
|
|
||
| namespace Internal.Cryptography | ||
| { | ||
| internal union EnvelopedCmsKey( | ||
| RSA, | ||
| #if NET11_0_OR_GREATER | ||
| MLKem, | ||
| CompositeMLKem, | ||
| #endif | ||
| EnvelopedCmsKey.None) | ||
| { | ||
| internal sealed record None | ||
| { | ||
| internal static None Instance { get; } = new None(); | ||
|
|
||
| private None() | ||
| { | ||
| } | ||
| } | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
...raries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/KemRecipientInfoPal.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
| using System.Security.Cryptography.Pkcs; | ||
|
|
||
| namespace Internal.Cryptography | ||
| { | ||
| internal abstract class KemRecipientInfoPal : RecipientInfoPal | ||
| { | ||
| internal abstract AlgorithmIdentifier KeyDerivationAlgorithm { get; } | ||
| internal abstract AlgorithmIdentifier KeyEncapsulationAlgorithm { get; } | ||
| internal abstract ReadOnlyMemory<byte> KeyEncapsulationCiphertext { get; } | ||
| internal abstract int KeyEncryptionKeyLengthInBytes { get; } | ||
| internal abstract ReadOnlyMemory<byte>? UserKeyingMaterial { get; } | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.