Known-answer test (KAT)
A self-test in which a cryptographic module encrypts, hashes or signs fixed inputs and checks the result against a precomputed expected value.
Cryptographic code has the unpleasant property that broken output looks just as random as correct output. An AES with a bug in its key schedule still produces noise — just the wrong noise — and nobody notices until a different implementation tries to decrypt it. A KAT is the simplest possible safeguard: run the algorithm on a test vector and compare it with the answer key.
FIPS 140 makes it mandatory. A validated module must run a KAT for every approved algorithm at power-up and refuse all cryptographic service if any test fails; an HSM that flunks its self-tests drops into an error state rather than carrying on. The test vectors typically come from NIST's algorithm validation programme, the same one used when CMVP certifies the module.