Sign data with ML-DSA
ML-DSA is the lattice-based signature scheme defined in FIPS 204. The signer uses the private key to produce a response tied to the message and its intended use, which is identified by the context. The verifier uses the public key to check that the response matches the message. For example, if you sign an update before distributing it, anyone with the corresponding public key can verify it independently.
How it works · ML-DSA challenge and response
| Parameter set | Public key (bytes) | Signature (bytes) | Python class |
|---|---|---|---|
| ML-DSA-44 | 1312 | 2420 | MlDsa44 |
| ML-DSA-65 | 1952 | 3309 | MlDsa65 |
| ML-DSA-87 | 2592 | 4627 | MlDsa87 |
The standard sign operation uses fresh randomness for each signature. Signatures for the same message can differ, so use verify to check validity. The context can be 0 to 255 bytes long and must match between signing and verification. Sign and verify a file · Rust API · FIPS 204