MlDsaConformanceTest
FIPS 204 known-answer tests from NIST's ACVP vectors (github.com/usnistgov/ACVP-Server, commit 975de31e), replayed through the public operations of any backend with ML-DSA: key generation from NIST's ξ, NIST's signatures byte for byte, NIST's verdicts, and the checks on imported keys. ML-DSA here is pure ML-DSA with an empty context, as COSE uses it (draft-ietf-cose-dilithium).
A backend's tests extend it with two factories, as for MlKemConformanceTest. The suite signs NIST's deterministic vectors with the hedged signer and a scripted rnd of 32 zero bytes, which is what the deterministic variant is (FIPS 204 §3.4), so the backend needs no deterministic mode.
The private keys are the seed or the expanded key of KeyType (seedLength, expandedPrivateKeyLength), and the backend imports both with importKeyPair. A key pair whose parts do not belong together, tr included (SignatureAlgorithm.trLength), is rejected with an exception other than UnsupportedAlgorithmException. Parameter sets the backend does not support are skipped, but it must support one.
Functions
FIPS 204 Algorithm 1 with NIST's ξ: the public key matches, and the private key is the seed or sk.
The seed and NIST's expanded sk (FIPS 204 Algorithm 24) are the same key: their deterministic signatures are identical, so K, tr, s1, s2 and t0 all agree.
FIPS 204 Algorithm 2, pure with an empty context: NIST's deterministic signatures (rnd = {0}^32) and its hedged signature (with NIST's rnd), byte for byte. Each one also verifies (Algorithm 3).
FIPS 204 Algorithm 3 reaches NIST's verdict.
Changes to NIST's valid signatures are rejected with false, never an exception: the commitment c~, the response z, an extra or a missing byte, and a hint encoding that HintBitUnpack (FIPS 204 Algorithm 21) refuses because its last index count exceeds ω.
Import takes NIST's seed and sk with their pk, leaves the caller's arrays alone, and refuses parts that do not belong together: wrong lengths, a changed seed, pk or sk, and a changed tr (FIPS 204 Algorithm 6, line 7), which leaves the public key the expanded key derives unchanged, so only a tr check catches it.