From eb50b46fed519cc80491ab208e9e89ef877fd2c6 Mon Sep 17 00:00:00 2001 From: Pranav Senthilnathan Date: Fri, 14 Aug 2026 17:08:40 -0700 Subject: [PATCH] Expose Composite ML-DSA CNG identifiers Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5676db47-d54b-4946-97ec-7fc0a7392c30 --- .../CompositeMLDsa/CompositeMLDsaTestHelpers.Cng.cs | 7 ------- .../ref/System.Security.Cryptography.cs | 4 ++++ .../src/System/Security/Cryptography/CngAlgorithm.cs | 3 ++- .../src/System/Security/Cryptography/CngAlgorithmGroup.cs | 3 ++- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaTestHelpers.Cng.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaTestHelpers.Cng.cs index 2a1692ef052113..9cca05a283dd3d 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaTestHelpers.Cng.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaTestHelpers.Cng.cs @@ -9,13 +9,6 @@ namespace System.Security.Cryptography.Tests { internal static partial class CompositeMLDsaTestHelpers { - private static readonly CngAlgorithm s_compositeMLDsa = new CngAlgorithm("Composite-ML-DSA"); - - extension (CngAlgorithm) - { - internal static CngAlgorithm CompositeMLDsa => s_compositeMLDsa; - } - private const int NTE_NOT_SUPPORTED = unchecked((int)0x80090029); internal static CompositeMLDsaCng ImportPublicKey(CompositeMLDsaAlgorithm algorithm, ReadOnlySpan source) diff --git a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs index c0ed4128c3b29a..6cf2e086576d60 100644 --- a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs +++ b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs @@ -326,6 +326,8 @@ public sealed partial class CngAlgorithm : System.IEquatable object that specifies the Composite Module-Lattice-Based /// Digital Signature Algorithm (Composite ML-DSA). /// - internal static CngAlgorithm CompositeMLDsa => + [Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)] + public static CngAlgorithm CompositeMLDsa => field ??= new CngAlgorithm("Composite-ML-DSA"); // BCRYPT_COMPOSITE_MLDSA_ALGORITHM private static CngAlgorithm? s_ecdh; diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmGroup.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmGroup.cs index 4e1cbe48dc5d0d..39a0c2a08fd010 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmGroup.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmGroup.cs @@ -164,7 +164,8 @@ public static CngAlgorithmGroup Rsa /// /// An object that specifies the Composite ML-DSA family of algorithms. /// - internal static CngAlgorithmGroup CompositeMLDsa => + [Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)] + public static CngAlgorithmGroup CompositeMLDsa => field ??= new CngAlgorithmGroup("CompositeMLDSA"); // NCRYPT_COMPOSITE_MLDSA_ALGORITHM_GROUP private static CngAlgorithmGroup? s_dh;