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