MLDSA87Sign

Cryptography

Description

Creates a 4627-byte ML-DSA-87 signature for a message and optional context

Syntax

Delphi

Function MLDSA87Sign(Const SecretKey, Message, Context, Rnd: AnsiString; Out Signature: AnsiString): Boolean;

Return values

True when SecretKey is 4896 bytes, Rnd is 32 bytes, Context is at most 255 bytes and a valid signature is produced
False for invalid lengths or when the bounded rejection-sampling budget is exhausted; Signature remains empty

Remarks

Use fresh unpredictable Rnd bytes for hedged signing, which is the recommended mode. All-zero Rnd selects deterministic signing and must not be reused as a substitute for entropy. The message and context are domain-separated as required by FIPS 204

Example

if MLDSA87Sign(SecretKey, Message, Context, Rnd, Signature) then
  Send(Message, Signature);

See also

MLDSA87KeyGen, MLDSA87Verify