Class MLKemAlgorithm
- Namespace
- CryptoHives.Foundation.Security.Cryptography.Kem
- Assembly
- CryptoHives.Foundation.Security.Cryptography.dll
Describes an ML-KEM parameter set (FIPS 203 Table 1) and its key, ciphertext, and shared secret sizes.
public sealed class MLKemAlgorithm : IEquatable<MLKemAlgorithm>
- Inheritance
-
MLKemAlgorithm
- Implements
- Inherited Members
Remarks
Instances are exposed as singletons (MLKem512,
MLKem768, MLKem1024) and
compared by name, so they are also equal by reference. The API shape mirrors
System.Security.Cryptography.MLKemAlgorithm from .NET 10 so code written
against the in-box types ports directly to older target frameworks.
Properties
CiphertextSizeInBytes
Gets the size of the ciphertext in bytes.
public int CiphertextSizeInBytes { get; }
Property Value
DecapsulationKeySizeInBytes
Gets the size of the expanded decapsulation (private) key in bytes.
public int DecapsulationKeySizeInBytes { get; }
Property Value
EncapsulationKeySizeInBytes
Gets the size of the encapsulation (public) key in bytes.
public int EncapsulationKeySizeInBytes { get; }
Property Value
MLKem1024
Gets the ML-KEM-1024 parameter set (NIST security category 5).
public static MLKemAlgorithm MLKem1024 { get; }
Property Value
MLKem512
Gets the ML-KEM-512 parameter set (NIST security category 1).
public static MLKemAlgorithm MLKem512 { get; }
Property Value
MLKem768
Gets the ML-KEM-768 parameter set (NIST security category 3).
public static MLKemAlgorithm MLKem768 { get; }
Property Value
Name
Gets the algorithm name, e.g. ML-KEM-768.
public string Name { get; }
Property Value
PrivateSeedSizeInBytes
Gets the size of the private seed (d ‖ z) in bytes (64).
public int PrivateSeedSizeInBytes { get; }
Property Value
SharedSecretSizeInBytes
Gets the size of the shared secret in bytes (32).
public int SharedSecretSizeInBytes { get; }
Property Value
Methods
Equals(MLKemAlgorithm?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MLKemAlgorithm? other)
Parameters
otherMLKemAlgorithmAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
- bool
true if the specified object is equal to the current object; otherwise, false.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator ==(MLKemAlgorithm?, MLKemAlgorithm?)
Determines whether two parameter sets are the same.
public static bool operator ==(MLKemAlgorithm? left, MLKemAlgorithm? right)
Parameters
leftMLKemAlgorithmThe first parameter set, or null.
rightMLKemAlgorithmThe second parameter set, or null.
Returns
operator !=(MLKemAlgorithm?, MLKemAlgorithm?)
Determines whether two parameter sets are different.
public static bool operator !=(MLKemAlgorithm? left, MLKemAlgorithm? right)
Parameters
leftMLKemAlgorithmThe first parameter set, or null.
rightMLKemAlgorithmThe second parameter set, or null.