Table of Contents

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

int

DecapsulationKeySizeInBytes

Gets the size of the expanded decapsulation (private) key in bytes.

public int DecapsulationKeySizeInBytes { get; }

Property Value

int

EncapsulationKeySizeInBytes

Gets the size of the encapsulation (public) key in bytes.

public int EncapsulationKeySizeInBytes { get; }

Property Value

int

MLKem1024

Gets the ML-KEM-1024 parameter set (NIST security category 5).

public static MLKemAlgorithm MLKem1024 { get; }

Property Value

MLKemAlgorithm

MLKem512

Gets the ML-KEM-512 parameter set (NIST security category 1).

public static MLKemAlgorithm MLKem512 { get; }

Property Value

MLKemAlgorithm

MLKem768

Gets the ML-KEM-768 parameter set (NIST security category 3).

public static MLKemAlgorithm MLKem768 { get; }

Property Value

MLKemAlgorithm

Name

Gets the algorithm name, e.g. ML-KEM-768.

public string Name { get; }

Property Value

string

PrivateSeedSizeInBytes

Gets the size of the private seed (d ‖ z) in bytes (64).

public int PrivateSeedSizeInBytes { get; }

Property Value

int

SharedSecretSizeInBytes

Gets the size of the shared secret in bytes (32).

public int SharedSecretSizeInBytes { get; }

Property Value

int

Methods

Equals(MLKemAlgorithm?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MLKemAlgorithm? other)

Parameters

other MLKemAlgorithm

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The 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

left MLKemAlgorithm

The first parameter set, or null.

right MLKemAlgorithm

The second parameter set, or null.

Returns

bool

true if both operands describe the same parameter set.

operator !=(MLKemAlgorithm?, MLKemAlgorithm?)

Determines whether two parameter sets are different.

public static bool operator !=(MLKemAlgorithm? left, MLKemAlgorithm? right)

Parameters

left MLKemAlgorithm

The first parameter set, or null.

right MLKemAlgorithm

The second parameter set, or null.

Returns

bool

true if the operands describe different parameter sets.