Click or drag to resize

DsaSign 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(
	DsaAlg alg,
	byte[] msg,
	byte[] sk,
	DsaSigOpts opts = DsaSigOpts.Default,
	byte[] context = null,
	string paramstr = ""
)

Parameters

alg  DsaAlg
DSA signature algorithm.
msg  Byte
Message to be signed.
sk  Byte
Private key.
opts  DsaSigOpts  (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