Generate a DSA signature over a message.
Namespace: CryptoSysPQCAssembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static byte[] Sign(
DsaAlg alg,
byte[] msg,
byte[] sk,
DsaSigOpts opts = DsaSigOpts.Default,
byte[] context = null,
string paramstr = ""
)
Public Shared Function Sign (
alg As DsaAlg,
msg As Byte(),
sk As Byte(),
Optional opts As DsaSigOpts = DsaSigOpts.Default,
Optional context As Byte() = Nothing,
Optional paramstr As String = ""
) As Byte()
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
ByteSignature in a byte array.
RemarksUse
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