CryptoSysPQC Namespace

A .NET interface to CryptoSys PQC.

Classes

Class Description
Dsa Digital Signature Algorithm (DSA) methods.
General Get general diagnostic info about the core native DLL.
HexExtension Extension methods for hex conversion
Kem Key-Encapsulation Mechanism (KEM) methods.
PqcErrorException PQC custom exception.
Rng Random Number Generator to NIST SP800-90

Structures

Structure Description
Dsa.KeyPair Object to hold a DSA key pair.
Kem.EncapOutput Object to hold output from KEM encapsulation.
Kem.KeyPair Object to hold a KEM key pair.

Enumerations

Enumeration Description
Dsa.Alg Digital Signature Algorithm (DSA) algorithm.
Dsa.PreHashAlg Hash function identifiers for pre-hash signing.
Dsa.SigOpts Signature options.
Kem.Alg Key-Encapsulation Mechanism (KEM) algorithm.

Dsa Class

Digital Signature Algorithm (DSA) methods.

Inheritance Hierarchy

System.Object
CryptoSysPQC.Dsa

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public class Dsa

The Dsa type exposes the following members.

Methods

Name Description
AlgName Get the algorithm name from its code
KeyGen Generate a DSA signing key pair (pk, sk).
PrivateKeySize Return length in bytes of (expanded) private key for the given DSA algorithm.
PublicKeyFromPrivate Extract the public key from a private key.
PublicKeySize Return length in bytes of public key for the given DSA algorithm.
Sign Generate a DSA signature over a message.
SignatureSize Return length in bytes of signature for the given DSA algorithm.
SignPreHash Generate a DSA signature over a pre-hashed message.
Verify Verify a DSA signature over a message.
VerifyPreHash Verify a DSA signature over a pre-hashed message.

See Also

CryptoSysPQC Namespace

Dsa.AlgName Method

Get the algorithm name from its code

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static string AlgName(
    Dsa.Alg alg
)

Parameters

alg Dsa.Alg

DSA signature algorithm

Return Value

String
Algorithm name

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.KeyGen Method

Generate a DSA signing key pair (pk, sk).

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static Dsa.KeyPair KeyGen(
    Dsa.Alg alg,
    string paramstr = ""
)

Parameters

alg Dsa.Alg

DSA signature algorithm

paramstr String (Optional)

Optional parameters string.

Return Value

Dsa.KeyPair
Keypair (pk, sk) in a Dsa.KeyPair object.

Remarks

Use paramstr to pass known test random material encoded in hexadecimal. For SLH-DSA this must represent exactly 3*n bytes (48/72/96 bytes) and for ML-DSA exactly 32 bytes. [default = add fresh randomness]

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.PrivateKeySize Method

Return length in bytes of (expanded) private key for the given DSA algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int PrivateKeySize(
    Dsa.Alg alg
)

Parameters

alg Dsa.Alg

DSA signature algorithm

Return Value

Int32
Length of key in bytes

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.PublicKeyFromPrivate Method

Extract the public key from a private key.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static byte[] PublicKeyFromPrivate(
    Dsa.Alg alg,
    byte[] sk
)

Parameters

alg Dsa.Alg

DSA signature algorithm.

sk Byte[]

Private key.

Return Value

Byte[]
Public key pk .

Exceptions

Exception Condition
PqcErrorException If parameters are bad, wrong lengths, etc.

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.PublicKeySize Method

Return length in bytes of public key for the given DSA algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int PublicKeySize(
    Dsa.Alg alg
)

Parameters

alg Dsa.Alg

DSA signature algorithm

Return Value

Int32
Length of key in bytes

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.Sign Method

Generate a DSA signature over a message.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static byte[] Sign(
    Dsa.Alg alg,
    byte[] msg,
    byte[] sk,
    Dsa.SigOpts opts = Dsa.SigOpts.Default,
    byte[] context = null,
    string paramstr = ""
)

Parameters

alg Dsa.Alg

DSA signature algorithm.

msg Byte[]

Message to be signed.

sk Byte[]

Private key.

opts Dsa.SigOpts (Optional)

Signature options.

context Byte[] (Optional)

Optional context string in byte array (maximum 255 bytes).

paramstr String (Optional)

Optional parameters string.

Return Value

Byte[]
Signature in a byte array.

Remarks

Use paramstr to pass known test random material encoded in hexadecimal [default = "" = add fresh randomness if in hedged mode]. For SLH-DSA this must represent exactly n bytes (16/24/32 bytes) and for ML-DSA exactly 32 bytes.

When using the ExternalMu-ML-DSA.Sign option (ExternalMu), pass the value of mu instead of the message. This must be exactly 64 bytes long. Caller is responsible for computing the value of mu independently prior to input.

For ML-DSA, the private key sk may be passed in expanded form (2560|4032|4896 bytes) or as a 32-byte seed. The key form is detected automatically by its length.

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.SignatureSize Method

Return length in bytes of signature for the given DSA algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int SignatureSize(
    Dsa.Alg alg
)

Parameters

alg Dsa.Alg

DSA signature algorithm

Return Value

Int32
Length of signature in bytes

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.SignPreHash Method

Generate a DSA signature over a pre-hashed message.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static byte[] SignPreHash(
    Dsa.Alg alg,
    byte[] msg,
    Dsa.PreHashAlg hashAlg,
    byte[] sk,
    Dsa.SigOpts opts = Dsa.SigOpts.Default,
    byte[] context = null,
    string paramstr = ""
)

Parameters

alg Dsa.Alg

DSA signature algorithm.

msg Byte[]

Hash digest of message to be signed PH_M = PH(M).

hashAlg Dsa.PreHashAlg

Pre-hash function used to create hash digest.

sk Byte[]

Private key.

opts Dsa.SigOpts (Optional)

Signature options.

context Byte[] (Optional)

Optional context string in byte array (maximum 255 bytes).

paramstr String (Optional)

Optional parameters string.

Return Value

Byte[]
Signature in a byte array.

Remarks

Use paramstr to pass known test random material encoded in hexadecimal [default = "" = add fresh randomness if in hedged mode]. For SLH-DSA this must represent exactly n bytes (16/24/32 bytes) and for ML-DSA exactly 32 bytes. For the pre-hash version, the hash digest of the message is passed instead of the message itself. Caller is responsible for computing the hash digest independently prior to input. The hash function used must be identifed in the hashAlg parameter.

For ML-DSA, the private key sk may be passed in expanded form (2560|4032|4896 bytes) or as a 32-byte seed. The key form is detected automatically by its length.

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.Verify Method

Verify a DSA signature over a message.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static bool Verify(
    Dsa.Alg alg,
    byte[] sig,
    byte[] msg,
    byte[] pk,
    byte[] context = null,
    Dsa.SigOpts opts = Dsa.SigOpts.Default
)

Parameters

alg Dsa.Alg

DSA signature algorithm.

sig Byte[]

Signature value.

msg Byte[]

Message to be verified.

pk Byte[]

Public key.

context Byte[] (Optional)

Optional context string in byte array to match context string used when signing.

opts Dsa.SigOpts (Optional)

Verify options.

Return Value

Boolean
True if signature verifies.

Exceptions

Exception Condition
PqcErrorException If parameters are bad, wrong lengths, etc.

Remarks

When using the ExternalMu-ML-DSA.Verify option (ExternalMu), pass the value of mu instead of the message. This must be exactly 64 bytes long. Caller is responsible for computing the value of mu independently prior to input.

See Also

Dsa Class
CryptoSysPQC Namespace

Dsa.VerifyPreHash Method

Verify a DSA signature over a pre-hashed message.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static bool VerifyPreHash(
    Dsa.Alg alg,
    byte[] sig,
    byte[] msg,
    Dsa.PreHashAlg hashAlg,
    byte[] pk,
    byte[] context = null,
    string paramstr = ""
)

Parameters

alg Dsa.Alg

DSA signature algorithm.

sig Byte[]

Signature value.

msg Byte[]

Hash digest of message to be verified PH_M = PH(M).

hashAlg Dsa.PreHashAlg

Pre-hash function used to create hash digest.

pk Byte[]

Public key.

context Byte[] (Optional)

Optional context string in byte array to match context string used when signing.

paramstr String (Optional)

Optional parameters string.

Return Value

Boolean
True if signature verifies.

Exceptions

Exception Condition
PqcErrorException If parameters are bad, wrong lengths, etc.

Remarks

For the pre-hash version, the hash digest of the message is passed instead of the message itself. Caller is responsible for computing the hash digest independently prior to input. The hash function used must be identifed in the hashAlg parameter.

See Also

Dsa Class
CryptoSysPQC Namespace

General Class

Get general diagnostic info about the core native DLL.

Inheritance Hierarchy

System.Object
CryptoSysPQC.General

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public class General

The General type exposes the following members.

Methods

Name Description
DllInfo Get information about the core native DLL.
ErrorLookup Return a description of an error code.
ModuleName Return full path name of core native DLL module being used.
NetVersion Return the version of this .NET module.
Version Get version number of core native diCrPQC DLL.

See Also

CryptoSysPQC Namespace

General.DllInfo Method

Get information about the core native DLL.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static string DllInfo()

Return Value

String
String in the form Platform=Win32|X64;Compiled=DDD;Licence=D|T

Remarks

Platform is the platform the core native DLL was compiled for: Win32 or X64.

Example

"Platform=X64;Compiled=Apr 2 2025 19:13:31;Licence=T"

See Also

General Class
CryptoSysPQC Namespace

General.ErrorLookup Method

Return a description of an error code.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static string ErrorLookup(
    int errCode
)

Parameters

errCode Int32

Code number (may be positive or negative)

Return Value

String
Corresponding error message.

See Also

General Class
CryptoSysPQC Namespace

General.ModuleName Method

Return full path name of core native DLL module being used.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static string ModuleName()

Return Value

String
File name.

Remarks

Note C:\WINDOWS\SYSTEM32\ may be returned even if it is really C:\WINDOWS\SYSWOW64\. Use General.DllInfo() to find out exactly which platform is being used (Win32 or X64).

See Also

General Class
CryptoSysPQC Namespace

General.NetVersion Method

Return the version of this .NET module.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static string NetVersion()

Return Value

String
Version string, e.g. "01.00.42"

See Also

General Class
CryptoSysPQC Namespace

General.Version Method

Get version number of core native diCrPQC DLL.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int Version()

Return Value

Int32
Version number in form Major * 10000 + Minor * 100 + Release

Remarks

E.g. version 1.2.3 returns 10203

See Also

General Class
CryptoSysPQC Namespace

HexExtension Class

Extension methods for hex conversion

Inheritance Hierarchy

System.Object
CryptoSysPQC.HexExtension

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static class HexExtension

The HexExtension type exposes the following members.

Methods

Name Description
FromHex Decode a hex-encoded string
ToHex Encode a byte array in hexadecimal

See Also

CryptoSysPQC Namespace

HexExtension.FromHex Method

Decode a hex-encoded string

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static byte[] FromHex(
    this string s
)

Parameters

s String

Input string of hex characters

Return Value

Byte[]
Decoded byte array #### Usage Note In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Example

byte[] b = "00010203".FromHex();  // { 0x00, 0x01, 0x02, 0x03 }

See Also

HexExtension Class
CryptoSysPQC Namespace

HexExtension.ToHex Method

Encode a byte array in hexadecimal

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static string ToHex(
    this byte[] b
)

Parameters

b Byte[]

Input byte array

Return Value

String
Hex-encoded string #### Usage Note In Visual Basic and C#, you can call this method as an instance method on any object of type Byte[]. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Example

byte[] b = { 0x00, 0x01, 0x02, 0x03 };
string s = b.ToHex());  // "00010203"

See Also

HexExtension Class
CryptoSysPQC Namespace

Kem Class

Key-Encapsulation Mechanism (KEM) methods.

Inheritance Hierarchy

System.Object
CryptoSysPQC.Kem

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public class Kem

The Kem type exposes the following members.

Methods

Name Description
AlgName Get the algorithm name from its Alg code
CipherTextSize Return length in bytes of ciphertext for the given KEM algorithm.
DecapKeySize Return length in bytes of expanded decapsulation key (“private key”) for the given KEM algorithm.
Decaps Carry out the ML-KEM decapsulation algorithm: (ss')<--Decaps(ct,dk)
EncapKeySize Return length in bytes of encapsulation key (“public key”) for the given KEM algorithm.
Encaps Carry out the ML-KEM encapsulation algorithm: (ct,ss)<--Encaps(ek)
KeyGen Generate an encapsulation/decapsulation key pair (ek, dk): (ek,dk)<--KeyGen()
SharedKeySize Return length in bytes of the shared key for the given KEM algorithm.

See Also

CryptoSysPQC Namespace

Kem.AlgName Method

Get the algorithm name from its Alg code

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static string AlgName(
    Kem.Alg alg
)

Parameters

alg Kem.Alg

KEM algorithm

Return Value

String
Algorithm name

Example

Console.WriteLine("alg=[{0}]", Kem.AlgName(Kem.Alg.ML_KEM_512));
// alg=[ML-KEM-512]

See Also

Kem Class
CryptoSysPQC Namespace

Kem.CipherTextSize Method

Return length in bytes of ciphertext for the given KEM algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int CipherTextSize(
    Kem.Alg alg
)

Parameters

alg Kem.Alg

KEM algorithm

Return Value

Int32
Length of ciphertext in bytes

Example

Console.WriteLine(Kem.CipherTextSize(Kem.Alg.ML_KEM_512));  // 768
Console.WriteLine(Kem.CipherTextSize(Kem.Alg.ML_KEM_768));  // 1088
Console.WriteLine(Kem.CipherTextSize(Kem.Alg.ML_KEM_1024)); // 1568

See Also

Kem Class
CryptoSysPQC Namespace

Kem.DecapKeySize Method

Return length in bytes of expanded decapsulation key (“private key”) for the given KEM algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int DecapKeySize(
    Kem.Alg alg
)

Parameters

alg Kem.Alg

KEM algorithm

Return Value

Int32
Length of key in bytes

Example

Console.WriteLine(Kem.DecapKeySize(Kem.Alg.ML_KEM_512));   // 1632
Console.WriteLine(Kem.DecapKeySize(Kem.Alg.ML_KEM_768));   // 2400
Console.WriteLine(Kem.DecapKeySize(Kem.Alg.ML_KEM_1024));  // 3168

See Also

Kem Class
CryptoSysPQC Namespace

Kem.Decaps Method

Carry out the ML-KEM decapsulation algorithm: (ss')<--Decaps(ct,dk)

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static byte[] Decaps(
    Kem.Alg alg,
    byte[] ct,
    byte[] dk
)

Parameters

alg Kem.Alg

KEM algorithm.

ct Byte[]

Ciphertext

dk Byte[]

Decapsulation key (either in expanded or “seed” form).

Return Value

Byte[]
Shared secret key ss. On failure, ss will contain a pseudo-random value.

See Also

Kem Class
CryptoSysPQC Namespace

Kem.EncapKeySize Method

Return length in bytes of encapsulation key (“public key”) for the given KEM algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int EncapKeySize(
    Kem.Alg alg
)

Parameters

alg Kem.Alg

KEM algorithm

Return Value

Int32
Length of key in bytes

Example

Console.WriteLine(Kem.EncapKeySize(Kem.Alg.ML_KEM_512));   // 800
Console.WriteLine(Kem.EncapKeySize(Kem.Alg.ML_KEM_768));   // 1184
Console.WriteLine(Kem.EncapKeySize(Kem.Alg.ML_KEM_1024));  // 1568

See Also

Kem Class
CryptoSysPQC Namespace

Kem.Encaps Method

Carry out the ML-KEM encapsulation algorithm: (ct,ss)<--Encaps(ek)

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static Kem.EncapOutput Encaps(
    Kem.Alg alg,
    byte[] ek,
    string paramstr = ""
)

Parameters

alg Kem.Alg

KEM algorithm.

ek Byte[]

Encapsulation key.

paramstr String (Optional)

Optional parameters string. Use to pass a known test random seed encoded in hexadecimal. If provided, this must represent exactly 32 bytes.

Return Value

Kem.EncapOutput
Shared secret key (ss) and ciphertext (ct) in a Kem.EncapOutput object.

See Also

Kem Class
CryptoSysPQC Namespace

Kem.KeyGen Method

Generate an encapsulation/decapsulation key pair (ek, dk): (ek,dk)<--KeyGen()

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static Kem.KeyPair KeyGen(
    Kem.Alg alg,
    string paramstr = ""
)

Parameters

alg Kem.Alg

KEM algorithm.

paramstr String (Optional)

Optional parameters string. Use to pass a known test random seed (d||z) representing exactly 64 bytes encoded in hexadecimal. [Default = use a fresh random value]

Return Value

Kem.KeyPair
Keypair (ek, dk) in a Kem.KeyPair object, where ek is the encapsulation (“public”) key and dk the decapsulation (“private”) key.

Remarks

If provided, the known test seed (d||z) must consist of two concatenated 32-byte values where d is the 32-byte “randomness” for the key generation and z is the 32-byte “implicit rejection value” to be used on a Decaps failure.

Example

// 1. Use known test vector seed = deterministic
Kem.KeyPair kp = Kem.KeyGen(Kem.Alg.ML_KEM_512, 
    "2CB843A02EF02EE109305F39119FABF49AB90A57FFECB3A0E75E179450F52761" 
  + "84CC9121AE56FBF39E67ADBD83AD2D3E3BB80843645206BDD9F2F629E3CC49B7");

// 2. Use fresh randomness
Kem.KeyPair kp = Kem.KeyGen(Kem.Alg.ML_KEM_512);

See Also

Kem Class
CryptoSysPQC Namespace

Kem.SharedKeySize Method

Return length in bytes of the shared key for the given KEM algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static int SharedKeySize(
    Kem.Alg alg
)

Parameters

alg Kem.Alg

KEM algorithm

Return Value

Int32
Length of key in bytes

Example

Console.WriteLine(Kem.SharedKeySize(Kem.Alg.ML_KEM_512));  // 32
Console.WriteLine(Kem.SharedKeySize(Kem.Alg.ML_KEM_768));  // 32
Console.WriteLine(Kem.SharedKeySize(Kem.Alg.ML_KEM_1024)); // 32

See Also

Kem Class
CryptoSysPQC Namespace

PqcErrorException Class

PQC custom exception.

Inheritance Hierarchy

System.Object
System.Exception
CryptoSysPQC.PqcErrorException

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public class PqcErrorException : Exception

The PqcErrorException type exposes the following members.

Constructors

Name Description
PqcErrorException() PQC error exception
PqcErrorException(Int32) PQC error exception
PqcErrorException(String) PQC error exception

See Also

CryptoSysPQC Namespace

PqcErrorException(Int32) Constructor

PQC error exception

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Overloads

Name Description
PqcErrorException() PQC error exception
PqcErrorException(Int32) PQC error exception
PqcErrorException(String) PQC error exception

Syntax

public PqcErrorException(
    int errcode
)

Parameters

errcode Int32

Error code

See Also

PqcErrorException Class
CryptoSysPQC Namespace

PqcErrorException(String) Constructor

PQC error exception

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Overloads

Name Description
PqcErrorException() PQC error exception
PqcErrorException(Int32) PQC error exception
PqcErrorException(String) PQC error exception

Syntax

public PqcErrorException(
    string message
)

Parameters

message String

Message string

See Also

PqcErrorException Class
CryptoSysPQC Namespace

Rng Class

Random Number Generator to NIST SP800-90

Inheritance Hierarchy

System.Object
CryptoSysPQC.Rng

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public class Rng

The Rng type exposes the following members.

Methods

Name Description
Bytes Generate an array of random bytes.

See Also

CryptoSysPQC Namespace

Rng.Bytes Method

Generate an array of random bytes.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static byte[] Bytes(
    int numBytes
)

Parameters

numBytes Int32

Required number of random bytes

Return Value

Byte[]
Array of random bytes

See Also

Rng Class
CryptoSysPQC Namespace

Dsa.KeyPair Structure

Object to hold a DSA key pair.

Inheritance Hierarchy

System.Object
System.ValueType
CryptoSysPQC.Dsa.KeyPair

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public struct KeyPair

The Dsa.KeyPair type exposes the following members.

Fields

Name Description
pk Public key
sk Private key

See Also

CryptoSysPQC Namespace

Dsa.KeyPair.pk Field

Public key

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public byte[] pk

Field Value

Byte[]

See Also

Dsa.KeyPair Structure
CryptoSysPQC Namespace

Dsa.KeyPair.sk Field

Private key

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public byte[] sk

Field Value

Byte[]

See Also

Dsa.KeyPair Structure
CryptoSysPQC Namespace

Kem.EncapOutput Structure

Object to hold output from KEM encapsulation.

Inheritance Hierarchy

System.Object
System.ValueType
CryptoSysPQC.Kem.EncapOutput

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public struct EncapOutput

The Kem.EncapOutput type exposes the following members.

Fields

Name Description
ct Ciphertext, ct
ss Shared secret key, ss

See Also

CryptoSysPQC Namespace

Kem.EncapOutput.ct Field

Ciphertext, ct

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public byte[] ct

Field Value

Byte[]

See Also

Kem.EncapOutput Structure
CryptoSysPQC Namespace

Kem.EncapOutput.ss Field

Shared secret key, ss

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public byte[] ss

Field Value

Byte[]

See Also

Kem.EncapOutput Structure
CryptoSysPQC Namespace

Kem.KeyPair Structure

Object to hold a KEM key pair.

Inheritance Hierarchy

System.Object
System.ValueType
CryptoSysPQC.Kem.KeyPair

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public struct KeyPair

The Kem.KeyPair type exposes the following members.

Fields

Name Description
dk Decapsulation key (“private” key)
ek Encapsulation key (“public” key)

See Also

CryptoSysPQC Namespace

Kem.KeyPair.dk Field

Decapsulation key (“private” key)

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public byte[] dk

Field Value

Byte[]

See Also

Kem.KeyPair Structure
CryptoSysPQC Namespace

Kem.KeyPair.ek Field

Encapsulation key (“public” key)

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public byte[] ek

Field Value

Byte[]

See Also

Kem.KeyPair Structure
CryptoSysPQC Namespace

Dsa.Alg Enumeration

Digital Signature Algorithm (DSA) algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public enum Alg

Members

Member name Description
ML_DSA_44 ML-DSA-44 from FIPS.204
ML_DSA_65 ML-DSA-65 from FIPS.204
ML_DSA_87 ML-DSA-87 from FIPS.204
SLH_DSA_SHA2_128S SLH-DSA-SHA2-128s from FIPS.205
SLH_DSA_SHA2_128F SLH-DSA-SHA2-128f from FIPS.205
SLH_DSA_SHA2_192S SLH-DSA-SHA2-192s from FIPS.205
SLH_DSA_SHA2_192F SLH-DSA-SHA2-192f from FIPS.205
SLH_DSA_SHA2_256S SLH-DSA-SHA2-256s from FIPS.205
SLH_DSA_SHA2_256F SLH-DSA-SHA2-256f from FIPS.205
SLH_DSA_SHAKE_128S SLH-DSA-SHAKE-128s from FIPS.205
SLH_DSA_SHAKE_128F SLH-DSA-SHAKE-128f from FIPS.205
SLH_DSA_SHAKE_192S SLH-DSA-SHAKE-192s from FIPS.205
SLH_DSA_SHAKE_192F SLH-DSA-SHAKE-192f from FIPS.205
SLH_DSA_SHAKE_256S SLH-DSA-SHAKE-256s from FIPS.205
SLH_DSA_SHAKE_256F SLH-DSA-SHAKE-256f from FIPS.205

See Also

CryptoSysPQC Namespace

Dsa.PreHashAlg Enumeration

Hash function identifiers for pre-hash signing.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public enum PreHashAlg

Members

Member name Description
Sha256 SHA-256 from FIPS.180-4
Sha384 SHA-384 from FIPS.180-4
Sha512 SHA-512 from FIPS.180-4
Sha224 SHA-224 from FIPS.180-4
Sha512_224 SHA-512/224 from FIPS.180-4
Sha512_256 SHA-512/256 from FIPS.180-4
Sha3_224 SHA3-224 from FIPS.202
Sha3_256 SHA3-256 from FIPS.202
Sha3_384 SHA3-384 from FIPS.202
Sha3_512 SHA3-512 from FIPS.202
Shake128_256 SHAKE-128-256 from FIPS.202
Shake256_512 SHAKE-256-512 from FIPS.202

See Also

CryptoSysPQC Namespace

Dsa.SigOpts Enumeration

Signature options.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

[FlagsAttribute]
public enum SigOpts

Members

Member name Description
Default Default options
Deterministic Use the deterministic variant when signing [default = hedged, add fresh randomness]
Internal Use Sign_internal or Verify_internal algorithm (for testing purposes).
ExternalMu Use ExternalMu-ML-DSA.Sign or ExternalMu-ML-DSA.Verify algorithm (ML-DSA only).

See Also

CryptoSysPQC Namespace

Kem.Alg Enumeration

Key-Encapsulation Mechanism (KEM) algorithm.

Namespace: CryptoSysPQC
Assembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public enum Alg

Members

Member name Description
ML_KEM_512 ML_KEM_512 from FIPS.203 (based on Kyber512)
ML_KEM_768 ML_KEM_768 from FIPS.203 (based on Kyber768)
ML_KEM_1024 ML_KEM_1024 from FIPS.203 (based on Kyber1024)

See Also

CryptoSysPQC Namespace


Created: 2025-10-20 20:08:57
Copyright (C) 2025 D.I. Management Services Pty Ltd t/a CryptoSys https://cryptosys.net