Testing
pnpm test
Runs in Node. Browser keypair() / sign() require loadOpfsSkWallet().
Covers ML-KEM-512 / 768 / 1024 round-trips, signature suites, and Wasm stack-zeroization checks (see src/*.test.ts). Heap-residue assumptions are spelled out in the SQIsign Wasm + WebGPU threat model.
Shared signature interface
import { loadFnDsa512, loadMlDsa3, loadSqisignLvl1 } from "quantum-resistant-rustykey";
async function main() {
const fnDsa = await loadFnDsa512();
const kp = fnDsa.keypair();
const publicKey = await kp.get("public_key");
const privateKey = await kp.get("private_key");
const message = "Authored by RustyKey";
const signature = await fnDsa.sign(message, privateKey);
console.log("Signature (hex):", fnDsa.buffer_to_string(signature));
const isValid = await fnDsa.verify(signature, message, publicKey);
console.log("Is signature valid?", isValid);
}
Known Answer Test excerpts and full vectors live in the test sources and on the Performance / KAT page.