3 instantiations of MLKemAlgorithm
System.Security.Cryptography (3)
src\libraries\Common\src\System\Security\Cryptography\MLKemAlgorithm.cs (3)
39public static MLKemAlgorithm MLKem512 { get; } = new("ML-KEM-512", 800, 1632, 768, Oids.MlKem512); 47public static MLKemAlgorithm MLKem768 { get; } = new("ML-KEM-768", 1184, 2400, 1088, Oids.MlKem768); 55public static MLKemAlgorithm MLKem1024 { get; } = new("ML-KEM-1024", 1568, 3168, 1568, Oids.MlKem1024);
57 references to MLKemAlgorithm
Microsoft.Bcl.Cryptography (1)
Microsoft.Bcl.Cryptography.Forwards.cs (1)
21[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.MLKemAlgorithm))]
System.Security.Cryptography (56)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.KemAlgs.cs (3)
26MlKem512 = EvpKemAvailable(MLKemAlgorithm.MLKem512.Name); 27MlKem768 = EvpKemAvailable(MLKemAlgorithm.MLKem768.Name); 28MlKem1024 = EvpKemAvailable(MLKemAlgorithm.MLKem1024.Name);
src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (16)
48public MLKemAlgorithm Algorithm { get; } 59protected MLKem(MLKemAlgorithm algorithm) 84public static MLKem GenerateKey(MLKemAlgorithm algorithm) 324/// <see cref="MLKemAlgorithm.PrivateSeedSizeInBytes" /> from <paramref name="algorithm" />. 336public static MLKem ImportPrivateSeed(MLKemAlgorithm algorithm, ReadOnlySpan<byte> source) 355/// <see cref="MLKemAlgorithm.PrivateSeedSizeInBytes" /> from <paramref name="algorithm" />. 369public static MLKem ImportPrivateSeed(MLKemAlgorithm algorithm, byte[] source) 395public static MLKem ImportDecapsulationKey(MLKemAlgorithm algorithm, ReadOnlySpan<byte> source) 427public static MLKem ImportDecapsulationKey(MLKemAlgorithm algorithm, byte[] source) 452public static MLKem ImportEncapsulationKey(MLKemAlgorithm algorithm, ReadOnlySpan<byte> source) 484public static MLKem ImportEncapsulationKey(MLKemAlgorithm algorithm, byte[] source) 1180MLKemAlgorithm algorithm = GetAlgorithmIdentifier(in identifier); 1663private static MLKemAlgorithm GetAlgorithmIdentifier(ref readonly AlgorithmIdentifierAsn identifier) 1665MLKemAlgorithm? algorithm = MLKemAlgorithm.FromOid(identifier.Algorithm); 1683MLKemAlgorithm algorithm = GetAlgorithmIdentifier(in algorithmIdentifier);
src\libraries\Common\src\System\Security\Cryptography\MLKemAlgorithm.cs (15)
15public sealed class MLKemAlgorithm : IEquatable<MLKemAlgorithm> 39public static MLKemAlgorithm MLKem512 { get; } = new("ML-KEM-512", 800, 1632, 768, Oids.MlKem512); 47public static MLKemAlgorithm MLKem768 { get; } = new("ML-KEM-768", 1184, 2400, 1088, Oids.MlKem768); 55public static MLKemAlgorithm MLKem1024 { get; } = new("ML-KEM-1024", 1568, 3168, 1568, Oids.MlKem1024); 112/// Compares two <see cref="MLKemAlgorithm" /> objects. 115/// An object to be compared to the current <see cref="MLKemAlgorithm"/> object. 121public bool Equals([NotNullWhen(true)] MLKemAlgorithm? other) => other is not null && other.Name == Name; 124public override bool Equals([NotNullWhen(true)] object? obj) => obj is MLKemAlgorithm alg && alg.Name == Name; 133/// Determines whether two <see cref="MLKemAlgorithm" /> objects specify the same algorithm name. 144public static bool operator ==(MLKemAlgorithm? left, MLKemAlgorithm? right) 150/// Determines whether two <see cref="MLKemAlgorithm" /> objects do not specify the same algorithm name. 161public static bool operator !=(MLKemAlgorithm? left, MLKemAlgorithm? right) 166internal static MLKemAlgorithm? FromOid(string? oid)
src\libraries\Common\src\System\Security\Cryptography\MLKemCng.cs (2)
52private static MLKemAlgorithm AlgorithmFromHandleWithPlatformCheck(CngKey key, out CngKey duplicateKey) 64private static partial MLKemAlgorithm AlgorithmFromHandle(CngKey key, out CngKey duplicateKey);
src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.cs (1)
21MLKemAlgorithm alg = key.Algorithm;
System\Security\Cryptography\Cng.NotSupported.cs (1)
423private static partial MLKemAlgorithm AlgorithmFromHandle(CngKey key, out CngKey duplicateKey)
System\Security\Cryptography\MLKemImplementation.OpenSsl.cs (9)
20MLKemAlgorithm algorithm, 30internal static MLKemImplementation GenerateKeyImpl(MLKemAlgorithm algorithm) 38internal static MLKemImplementation ImportPrivateSeedImpl(MLKemAlgorithm algorithm, ReadOnlySpan<byte> source) 47internal static MLKemImplementation ImportDecapsulationKeyImpl(MLKemAlgorithm algorithm, ReadOnlySpan<byte> source) 56internal static MLKemImplementation ImportEncapsulationKeyImpl(MLKemAlgorithm algorithm, ReadOnlySpan<byte> source) 115private static string MapAlgorithmToName(MLKemAlgorithm algorithm) 119if (algorithm == MLKemAlgorithm.MLKem512) 123else if (algorithm == MLKemAlgorithm.MLKem768) 127else if (algorithm == MLKemAlgorithm.MLKem1024)
System\Security\Cryptography\MLKemOpenSsl.cs (1)
62private static partial MLKemAlgorithm AlgorithmFromHandle(
System\Security\Cryptography\MLKemOpenSsl.OpenSsl.cs (4)
18private static partial MLKemAlgorithm AlgorithmFromHandle( 43return MLKemAlgorithm.MLKem512; 45return MLKemAlgorithm.MLKem768; 47return MLKemAlgorithm.MLKem1024;
System\Security\Cryptography\X509Certificates\PublicKey.cs (1)
348if (MLKemAlgorithm.FromOid(_oid.Value) is null)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (3)
797if (MLKemAlgorithm.FromOid(GetKeyAlgorithm()) is null) 818MLKemAlgorithm? algorithm = MLKemAlgorithm.FromOid(GetKeyAlgorithm());