Generate a DSA signature over a pre-hashed message.
Namespace: CryptoSysPQCAssembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static byte[] SignPreHash(
DsaAlg alg,
byte[] msg,
DsaPreHashAlg hashAlg,
byte[] sk,
DsaSigOpts opts = DsaSigOpts.Default,
byte[] context = null,
string paramstr = ""
)
Public Shared Function SignPreHash (
alg As DsaAlg,
msg As Byte(),
hashAlg As DsaPreHashAlg,
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
- Hash digest of message to be signed PH_M = PH(M).
- hashAlg DsaPreHashAlg
- Pre-hash function used to create hash digest.
- 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.
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