Skip to content

Commit 663c457

Browse files
Expose Composite ML-DSA CNG identifiers (#132353)
Fixes #130052 > [!NOTE] > This PR description was generated with GitHub Copilot. Copilot-Session: 5676db47-d54b-4946-97ec-7fc0a7392c30
1 parent 6630185 commit 663c457

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaTestHelpers.Cng.cs‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ namespace System.Security.Cryptography.Tests
99
{
1010
internal static partial class CompositeMLDsaTestHelpers
1111
{
12-
private static readonly CngAlgorithm s_compositeMLDsa = new CngAlgorithm("Composite-ML-DSA");
13-
14-
extension (CngAlgorithm)
15-
{
16-
internal static CngAlgorithm CompositeMLDsa => s_compositeMLDsa;
17-
}
18-
1912
private const int NTE_NOT_SUPPORTED = unchecked((int)0x80090029);
2013

2114
internal static CompositeMLDsaCng ImportPublicKey(CompositeMLDsaAlgorithm algorithm, ReadOnlySpan<byte> source)

‎src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ public sealed partial class CngAlgorithm : System.IEquatable<System.Security.Cry
336336
{
337337
public CngAlgorithm(string algorithm) { }
338338
public string Algorithm { get { throw null; } }
339+
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
340+
public static System.Security.Cryptography.CngAlgorithm CompositeMLDsa { get { throw null; } }
339341
public static System.Security.Cryptography.CngAlgorithm ECDiffieHellman { get { throw null; } }
340342
public static System.Security.Cryptography.CngAlgorithm ECDiffieHellmanP256 { get { throw null; } }
341343
public static System.Security.Cryptography.CngAlgorithm ECDiffieHellmanP384 { get { throw null; } }
@@ -365,6 +367,8 @@ public sealed partial class CngAlgorithmGroup : System.IEquatable<System.Securit
365367
{
366368
public CngAlgorithmGroup(string algorithmGroup) { }
367369
public string AlgorithmGroup { get { throw null; } }
370+
[System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
371+
public static System.Security.Cryptography.CngAlgorithmGroup CompositeMLDsa { get { throw null; } }
368372
public static System.Security.Cryptography.CngAlgorithmGroup DiffieHellman { get { throw null; } }
369373
public static System.Security.Cryptography.CngAlgorithmGroup Dsa { get { throw null; } }
370374
public static System.Security.Cryptography.CngAlgorithmGroup ECDiffieHellman { get { throw null; } }

‎src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithm.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ public static CngAlgorithm Sha512
236236
/// A new <see cref="CngAlgorithm"/> object that specifies the Composite Module-Lattice-Based
237237
/// Digital Signature Algorithm (Composite ML-DSA).
238238
/// </value>
239-
internal static CngAlgorithm CompositeMLDsa =>
239+
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
240+
public static CngAlgorithm CompositeMLDsa =>
240241
field ??= new CngAlgorithm("Composite-ML-DSA"); // BCRYPT_COMPOSITE_MLDSA_ALGORITHM
241242

242243
private static CngAlgorithm? s_ecdh;

‎src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmGroup.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ public static CngAlgorithmGroup Rsa
164164
/// <value>
165165
/// An object that specifies the Composite ML-DSA family of algorithms.
166166
/// </value>
167-
internal static CngAlgorithmGroup CompositeMLDsa =>
167+
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
168+
public static CngAlgorithmGroup CompositeMLDsa =>
168169
field ??= new CngAlgorithmGroup("CompositeMLDSA"); // NCRYPT_COMPOSITE_MLDSA_ALGORITHM_GROUP
169170

170171
private static CngAlgorithmGroup? s_dh;

0 commit comments

Comments
 (0)