nqselftest(3)
NAME
nqselftest — known
answers for every algorithm family
SYNOPSIS
#include
<noqtis.h>
int
nqselftest(void);
DESCRIPTION
nqselftest()
runs fixed inputs through the public functions of every algorithm family and
compares what they produce with answers built into the library, the kind of
self-test a cryptographic module runs before it is used (FIPS 140-3, section
7.10):
- SHA-224 to SHA-512/256, SHA3-224 to SHA3-512, SHAKE128 and SHAKE256 of “abc”;
- HMAC-SHA-256 and HMAC-SHA-512 (RFC 4231, test case 2);
- ML-KEM-512, -768 and -1024: a key pair and an encapsulation from fixed seeds, and the decapsulation;
- ML-DSA-44, -65 and -87: a key pair from a fixed seed, the deterministic signature of a fixed message and its verification;
- SLH-DSA-SHA2-128f and SLH-DSA-SHAKE-128f: a key pair from a fixed seed;
- HQC-128: a key pair, an encapsulation and the decapsulation;
- Ed25519 and ML-DSA-44+Ed25519: a key pair, a deterministic signature and its verification.
Each family's keys, ciphertexts, signatures, secrets and return codes are hashed with SHA-256; a decapsulation or verification that disagrees changes the hash. The masked decapsulations and signers run as in normal use. It takes about a tenth of a second and allocates nothing.
RETURN VALUES
NQOK when every answer matches;
NQEKAT when one does not.