test suite - xero/leviathan-crypto GitHub Wiki
Describes the unit and e2e test inventory, gate structure, and the complete vector corpus with source provenance for all tests.
Tip
Looking for how to run the test suite locally? See development.md. This document describes what the suite contains; the development doc covers how to invoke it.
| Type | Runner | Tests | Status |
|---|---|---|---|
| Unit | Vitest | 6336 | All pass |
| e2e | Playwright | 387 (129 tests × 3 browsers) | All pass |
| Total | 6723 | All pass |
The Gate column reflects in-test gating: the simplest authoritative vector for a primitive must pass before any other tests in that family are written or run. GATE marks the primary gate; numbered values (Gate 1, Gates 1-6, Gate 0/1/2/3/4/5/6/7) indicate gates within multi-gate families. See architecture.md#gate-discipline for the design rationale.
| File | Description | Vectors / Tests | Gate |
|---|---|---|---|
init.test.ts |
init() API: error-before-init (serpent, sha3, keccak), unknown module rejection, embedded (single, multiple, all four modules), ArrayBuffer source, idempotent, partial init isolation, keccak alias (init, shared instance, cross-name, idempotent, both names, subpath init, embedded re-export), WASM getModuleId() exports (modules 0-3) |
18 tests | - |
init/exclusivity.test.ts |
Per-module exclusivity guard for stateful classes. sha3 (SHAKE128/256, reset() keeps token, atomic SHA3_256 blocked, live KMAC128/KMACXOF256/CSHAKE128 block every other sha3 user), chacha20 (ChaCha20, atomic Poly1305/ChaCha20Poly1305/XChaCha20Poly1305 blocked), serpent (SerpentCtr/SerpentCbc, atomic Serpent blocked, SerpentCipher via Seal blocked), cross-module independence, idempotent dispose, shared-state clobber reproducer, post-dispose method-call guards (SHAKE128/256 reset/absorb/squeeze/hash, ChaCha20 beginEncrypt/encryptChunk, SerpentCtr, SerpentCbc encrypt/decrypt), disposed-instance-does-not-clobber-new-instance, mlkem ↔ sha3 interleave (SHAKE128 blocks MlKem768 keygen/encapsulate/decapsulate/checkEncapsulationKey via assertNotOwned, atomic ops do not persist token, MlKemBase.dispose() preserves live SHAKE128 state) | 48 tests | - |
init/init-race.test.ts |
Concurrent initModule calls coalesce via the pending-promise cache (2-way reference equality, single compile, sequential init after concurrent is a no-op); _resetForTesting clears instances, owners, and pending maps |
6 tests | - |
init/atomic-defense.test.ts |
Per-method _assertNotOwned guard on atomic WASM-touching methods. sha3 (SHA3_256/512/384/224.hash, KMAC128.verify, KMAC256.verify blocked by SHAKE128), chacha20 (Poly1305.mac, ChaCha20Poly1305 encrypt/decrypt, XChaCha20Poly1305 encrypt/decrypt, XChaCha20Cipher.sealChunk via Seal.encrypt blocked by ChaCha20), serpent (Serpent.loadKey/encryptBlock/decryptBlock blocked by SerpentCtr), sha2 simulated (SHA256/512/384.hash + HMAC_SHA256/512/384.hash + dispose blocked by _acquireModule), HKDF indirection via HMAC |
28 tests | - |
init/internal-api-stripped.test.ts |
@internal-tagged init exports (_resetForTesting, _acquireModule, _releaseModule, _isModuleBusy, _assertNotOwned) are absent from dist/init.d.ts. Root-barrel leakage check (dist/index.d.ts, dist/index.js) and Fortuna class (dist/fortuna.d.ts). The five v2.1.1-removed _<module>Ready probes (_serpentReady, _chachaReady, _sha2Ready, _sha3Ready, _mlkemReady) are absent from the root barrel and from each submodule's .d.ts and .js. Gated on dist files existing, skipped in sessions without bun bake. |
21 tests | - |
errors.test.ts |
AuthenticationError: constructor, message format, prototype chain, instanceof |
5 tests | - |
utils.test.ts |
hex (odd-length throw), utf8, base64 (url-safe unpadded), constantTimeEqual, wipe, xor, variadic concat, randomBytes
|
37 tests | - |
loader/wasm_source.test.ts |
WasmSource loading: all 7 source types (embedded string, URL, ArrayBuffer, Uint8Array, WebAssembly.Module, Response, Promise<Response>), invalid inputs (null, number, empty string, corrupt base64, truncated ArrayBuffer), double-init idempotency |
14 tests | - |
loader/thenable-dispatch.test.ts |
Loader thenable dispatch: Promise<Response> / Promise<ArrayBuffer> / Promise<Uint8Array> / Promise<string> resolve and re-dispatch by runtime type; nested native Promise.resolve chains collapse during await; depth-4 seeded recursion trips thenable nesting too deep (max 3)
|
6 tests | - |
cte/compare-branch-free.test.ts |
constantTimeEqual SIMD branch-free implementation: equal/diff inputs across length sweep (0, 1, 15..33, …), single-bit difference at every position, length-mismatch returns false, prefix attack returns false |
20 tests | - |
cte/module-shape.test.ts |
cte.wasm invariants: imports nothing, exports a memory of kind memory sized at 1 page, exports a compare function |
3 tests | - |
serpent/serpent_sbox.test.ts |
S-box table entries (serpent_ecb_tbl.txt) |
1536 vectors, 2 tests | Gate 1 |
serpent/serpent_iv.test.ts |
Key schedule intermediate values (serpent_ecb_iv.txt) |
3 key sizes, 2 tests | Gate 2 |
serpent/serpent_kat.test.ts |
KAT variable-text + variable-key (serpent_ecb_vt/vk.txt) |
960 vectors, 6 tests | - |
serpent/serpent_nessie128.test.ts |
NESSIE 128-bit vectors | 1028 vectors, 3 tests | - |
serpent/serpent_nessie192.test.ts |
NESSIE 192-bit vectors | 1156 vectors, 3 tests | - |
serpent/serpent_nessie256.test.ts |
NESSIE 256-bit vectors | 1284 vectors, 3 tests | - |
serpent/serpent_ctr.test.ts |
CTR mode cases A-E | 5 tests | - |
serpent/serpent_wipe.test.ts |
wipeBuffers() verification |
1 test | - |
serpent/serpent.test.ts |
SerpentCbc/SerpentCtr dangerUnauthenticated gate |
4 tests | - |
serpent/serpent_cbc.test.ts |
CBC PKCS7 padding lengths (0-17B), round-trips (single/partial/four blocks, 65536B/65537B chunk-boundary, empty), invalid padding rejection (tamper, bad length, empty, zero-byte), IV sensitivity, CBC chaining verification, WASM chunk boundary (CHUNK_SIZE encrypt/reject/roundtrip, overflow guard), parameter validation | 28 tests | - |
serpent/pkcs7-oracle.test.ts |
CT-safe PKCS7 padding: all failure modes throw the same generic error, error messages leak no numeric data, happy-path round-trip preserved, timing-invariance sweep, SerpentCipher HMAC-verifies before pkcs7Strip runs, pkcs7Strip correctness across padLen ∈ [1,16] and rejection of every out-of-range trailing byte |
398 tests | - |
serpent/exclusivity-preservation.test.ts |
Exclusivity-guard preservation across the higher-level wrappers: Seal.encrypt(SerpentCipher), Seal.decrypt(SerpentCipher), SealStream.push(SerpentCipher) all surface _assertNotOwned clearly when the serpent module is held by a stateful instance |
9 tests | - |
serpent/pool-shared-ops.test.ts |
Shared-ops module (worker bridge): cbcEncryptChunk and SIMD cbcDecryptChunk parity with main thread, pkcs7Strip branch-free padding check, hmacSha256 against RFC 4231, end-to-end pkcs7 round-trip against the shared-ops surface |
32 tests | - |
serpent/serpent_montecarlo.test.ts |
ECB Monte Carlo (1200 × 10000 enc + dec, serpent_ecb_e_m.txt / serpent_ecb_d_m.txt) |
2400 outer, 4 tests | - |
serpent/serpent_cbc_montecarlo.test.ts |
CBC Monte Carlo (1200 × 10000 enc + dec, serpent_cbc_e_m.txt / serpent_cbc_d_m.txt) |
2400 outer, 4 tests | - |
serpent/serpent_simd_gate.test.ts |
SIMD 4-wide ECB gate: byte-identical to scalar for two keys | 2 tests | GATE |
serpent/serpent_simd_ctr.test.ts |
SIMD CTR cross-check: cases A-E, SIMD output matches scalar byte-for-byte | 5 tests | - |
serpent/serpent_simd_cbc.test.ts |
SIMD CBC decrypt cross-check: 1-12 block sweep + 4KB/16KB/64KB, SIMD matches scalar | 15 tests | - |
serpent/serpent_simd_cbc_gate.test.ts |
SIMD CBC decrypt gate: inner loop, scalar tail, multi-iteration, chaining continuity across chunk boundaries | 6 tests | GATE |
chacha20/chacha20.test.ts |
ChaCha20 block + encryption + round-trips | 6 tests | Gate 3 |
chacha20/chacha20_simd_4x_gate.test.ts |
4-wide inter-block SIMD: byte-identical to scalar for 192/256/320/512/337 bytes | 5 tests | GATE |
chacha20/chacha20_simd.test.ts |
SIMD cross-check: RFC §2.4.2 vector + size sweep (64-65536B) + round-trip | 11 tests | - |
chacha20/poly1305.test.ts |
Poly1305 MAC vectors (§2.5.2, §2.6.2, A.3 #1-#6) | 9 tests | Gate 4 |
chacha20/chacha20poly1305.test.ts |
ChaCha20-Poly1305 AEAD (§2.8.2, round-trips, tamper, validation). Wipe-after-return: after a successful encrypt/decrypt, KEY_OFFSET and POLY_KEY_OFFSET read as zeros, verifies the atomic-class try/finally wipeBuffers() discipline |
28 tests | Gate 5 |
chacha20/xchacha20.test.ts |
XChaCha20-Poly1305 (HChaCha20, §A.3.2, round-trips, tamper, validation). Wipe-after-return: after a successful encrypt/decrypt, KEY_OFFSET, POLY_KEY_OFFSET, and XCHACHA_SUBKEY_OFFSET read as zeros, verifies the atomic-class try/finally wipeBuffers() discipline (HChaCha20 inner-key material included) |
21 tests | Gate 6 |
chacha20/single-use-guard.test.ts |
Strict single-use guard on ChaCha20Poly1305.encrypt() and XChaCha20Poly1305.encrypt(): happy path locks after one call; crypto-path throw locks; validation throws on key/nonce length ALSO lock, every retry on a used instance surfaces the single-use error |
8 tests | - |
chacha20/aead-decrypt-wipe.test.ts |
ChaCha20Poly1305.decrypt wipe-on-auth-failure: CHUNK_CT region zeroed, CHACHA_BLOCK_BUFFER zeroed, POLY_KEY_BUFFER zeroed (regression for residual key bytes after tamper) |
3 tests | - |
sha2/sha224.test.ts |
SHA-224 vectors (FIPS 180-4 §6.3 / §5.3.2 IV, empty, NIST "abc", 56/64-byte boundaries, pangram), streaming 4×64B, leviathan cross-check | 10 tests | GATE |
sha2/sha256.test.ts |
SHA-256 vectors, streaming, wipeBuffers, leviathan cross-check |
11 tests | Gate 3 |
sha2/sha512.test.ts |
SHA-512, SHA-384 vectors, streaming, leviathan cross-check | 14 tests | Gate 4 |
sha2/sha512_224.test.ts |
SHA-512/224 vectors (FIPS 180-4 §6.7.1 / §5.3.6.1 IV, empty, NIST "abc", 111/112/128-byte boundaries, pangram), streaming 4×128B, leviathan cross-check | 10 tests | GATE |
sha2/sha512_256.test.ts |
SHA-512/256 vectors (FIPS 180-4 §6.7.2 / §5.3.6.2 IV, empty, NIST "abc", 111/112/128-byte boundaries, pangram), streaming 4×128B, leviathan cross-check | 10 tests | GATE |
sha2/hmac.test.ts |
HMAC-SHA256/512/384 vectors (RFC 4231 TC1/TC2/TC6), leviathan cross-check | 14 tests | Gates 5, 6 |
sha2/hkdf.test.ts |
HKDF-SHA256 RFC 5869 A.1-A.3, HKDF-SHA512 generated vectors, extract/expand isolation, derive consistency, RangeError guards, salt defaults, dispose | 22 tests | Gate 8 |
sha3/sha3.test.ts |
SHA3-224/256/384/512, SHAKE128/256 (single + multi-block), incremental absorb/squeeze, state machine guards, dispose zeroes TS buffer, wipeBuffers, leviathan cross-check |
61 tests | Gate 7 |
sha3/sha3_stream.test.ts |
SHA3_256Stream and SHA3_512Stream incremental hashers: update() / finalize() round-trip against the one-shot SHA3_256 / SHA3_512 classes (single-shot, multi-chunk, empty input), exclusivity token acquired at construction (blocks SHAKE128 / one-shot SHA3 ops on the sha3 module), dispose() releases the token, double-dispose idempotent, post-finalize / post-dispose method calls throw, finalize() auto-disposes after returning the digest |
16 tests | - |
sha3/shake_xof.test.ts |
SHAKE128/256 multi-squeeze KAT: rate-boundary crossing (MS-1-3, MS-5-7), byte-by-byte squeeze (MS-4, MS-8), reset after multi-squeeze (MS-9) | 10 tests | - |
sha3/kmac.test.ts |
cSHAKE128/256, KMAC128/256, KMACXOF128/256 (SP 800-185). NIST CSRC sample values (12 records) + ACVP byte-aligned subset (cSHAKE128/256 via internal _cshake*Raw, KMAC128 fixed-output, KMACXOF256; KMAC256-ACVP and KMACXOF128-ACVP slots are empty by ACVP filter and pinned by the vector file invariants block) + streaming-matches-one-shot for fixed-output and XOF variants + error paths (empty customization/key, outLen=0, negative squeeze, update-after-finalize, update-after-squeeze, AuthenticationError discriminator from KMAC{128,256}.verify) + dispose zeroes WASM state + idempotent dispose + post-dispose method calls throw |
57 tests | Gate 8 (cSHAKE128 §A) |
blake3/blake3-compress.test.ts |
BLAKE3 §2.2 single-block compression gate against the empty-input KAT (blake3Vectors[0], sourced from upstream BLAKE3 test_vectors.json): CV = IV (§2.2 Table 1), block = 64 zero bytes, counter = 0, blockLen = 0, flags = CHUNK_START | CHUNK_END | ROOT; asserts the first 32 output bytes match the first 64 hex chars of the vector's hashHex
|
1 test | GATE |
blake3/blake3-kat.test.ts |
BLAKE3 hash KAT against all 35 upstream records: hash(expandBlake3Input(inputLen)) first 32 output bytes match the first 64 hex chars of each record's hashHex. Exercises the §2.4 chunk machine, §2.5 tree assembly (queue-per-level discipline), and §2.5 root finalization across every chunk and CV-stack boundary the design exercises (inputLen 0..102400) |
35 tests | GATE |
blake3/blake3-compress4-equiv.test.ts |
BLAKE3 compress4 (v128-external SIMD, lane K = compress operation K) bit-equivalence vs four sequential compress1 calls across 64 deterministic random-seeded iterations (CV, message, counter, block_len per lane and a shared flags value); identical-CV spot check across 16 iterations (shared CV, distinct msg/counter/blockLen per lane) to catch cross-lane register leaks the random-distinct sweep would not localize; direct compress4 KAT against 4 fixed records from test/vectors/blake3_compress4.ts whose expected outputs were derived from compress1. compress1's own §2.2 gate (blake3-compress.test.ts) is the authority for compression correctness; this test gates the §5.3 SIMD lane-parallel form |
3 tests | GATE |
blake3/blake3-compress4-dispatch.test.ts |
BLAKE3 §2.4 + §5.3 chunk-level compress4 dispatch coverage: drives a test-only WASM chunkBatch4 invocation counter to prove hashCore actually routes 4-chunk batches through the v128-external compress4 kernel for multi-chunk inputs (≥ 4096 bytes) rather than silently falling through to the per-block single-chunk path. Asserts exact batch counts for 4096 / 5120 / 16384-byte inputs, zero-batch counts for 1024 / 4095-byte inputs; verifies dispatch fires across all three modes (hash, keyed_hash, derive_key); KAT regression over every upstream record with inputLen >= 4096 (13 cases) confirms the dispatched output is byte-identical to the prior single-chunk implementation |
21 tests | GATE |
blake3/blake3-parent-dispatch.test.ts |
BLAKE3 §2.5 + §5.3 parent-level compress4 dispatch coverage: drives a test-only WASM parentBatch4 invocation counter to prove the queue-per-level discipline in tree.ts actually routes parent merges through compress4 for inputs producing ≥ 8 chunks. Asserts exact batch counts at 4096 / 7168 / 8192 / 16384 / 32768 / 65536-byte inputs matching the cascade predicted by the queue-per-level invariants; verifies dispatch fires across all three modes (hash, keyed_hash, derive_key pass 2); KAT regression over every upstream record with inputLen >= 8192 (5 cases) confirms the queue-per-level reorganization produces byte-identical output to the prior ctz-stack implementation |
14 tests | GATE |
blake3/blake3-keyed-hash.test.ts |
BLAKE3 keyed_hash KAT against all 35 upstream records, BLAKE3 §2.3 Modes: hashKeyed(blake3Key, expandBlake3Input(inputLen)) first 32 output bytes match the first 64 hex chars of each record's keyedHashHex. Starting CV is the 32 key bytes (LE u32 reinterpretation, identical to a memcpy on a LE host); every compress carries the KEYED_HASH flag in addition to the structural CHUNK_START / CHUNK_END / PARENT / ROOT bits |
35 tests | GATE |
blake3/blake3-derive-key.test.ts |
BLAKE3 derive_key KAT against all 35 upstream records, BLAKE3 §2.3 Modes two-pass: pass 1 hashes blake3ContextString with starting CV = IV and DERIVE_KEY_CONTEXT flag on every compress to produce a 32-byte context_chain_value; pass 2 hashes expandBlake3Input(inputLen) with starting CV = context_chain_value and DERIVE_KEY_MATERIAL flag on every compress; first 32 output bytes match the first 64 hex chars of each record's deriveKeyHex
|
35 tests | GATE |
blake3/blake3-surface.test.ts |
BLAKE3 TS public surface smoke: empty-input KAT round trips through BLAKE3.hash / BLAKE3KeyedHash.hash / BLAKE3DeriveKey.derive; streamed (BLAKE3Stream / BLAKE3KeyedHashStream / BLAKE3DeriveKeyStream) chunked equals one-shot; BLAKE3OutputReader.read(32) empty-input matches blake3Vectors[0].hashHex.slice(0,64); BLAKE3Hash Fortuna HashFn shape (outputSize, wasmModules, digest); dispose idempotency across all classes; lifecycle guards (update-after-finalize, update-after-finalizeXof, read-after-dispose); validateKey length check; validateContext empty-context rejection |
16 tests | - |
blake3/blake3-tree-internals.test.ts |
BLAKE3 tree-internals substrate (drives blake3-tree Merkle-tree substrate), BLAKE3 §2.4 / §2.5: drives the WASM _testChunkCV / _testParentCV / _testDeriveContextCV test-only exports through test/unit/blake3/helpers.ts; verifies hand-composed chunk + parent CVs reproduce BLAKE3.hash / BLAKE3KeyedHash.hash / BLAKE3DeriveKey.derive byte-for-byte across 2-chunk (2048 B, GATE) and 4-chunk (4096 B) inputs in all three modes (hash / keyed_hash / derive_key with the pass-1 _deriveContextCV CCV bridging into pass-2 mode flags); 1-chunk single-block consistency check (_chunkCV chunk pipeline matches direct compress with CHUNK_START|CHUNK_END, no ROOT) |
7 tests | GATE |
blake3/blake3-streaming.test.ts |
BLAKE3 streaming vs one-shot equivalence across all three modes (hash / keyed_hash / derive_key) and 10 input sizes covering every chunk- and tree-boundary the design touches (0, 1, 63, 64, 1023, 1024, 1025, 4096, 4097, 65536 bytes) × multiple split patterns per size (whole-input, 1-byte chunks for ≤ 1024, 7-byte chunks for ≤ 16384, 64-byte chunks, 1024-byte chunks). Catches compress1 / compress4 dispatch bugs in the streaming-class fallback path | 135 tests | - |
blake3/blake3-xof.test.ts |
BLAKE3 §2.6 XOF reader: 1-byte-at-a-time read of 131-byte output, 7-byte chunk reads, 64-byte chunk reads, reads across the 64-byte block boundary (60 + 8 + 63), and full 131-byte single read of every blake3Vectors[i] for all three modes (35 × 3 = 105 cases); read-after-dispose throws. Exercises the WASM squeezeXofBlock snapshot path past the initial root compress |
110 tests | - |
blake3/blake3-large-input.test.ts |
BLAKE3 cross-check against the BLAKE3-team Rust oracle for input sizes outside the upstream 35-record KAT corpus: 8000 B (between KAT 7169 and 8192), 65536 B and 100000 B (in the gap between KAT 31744 and 102400). All three modes × full 131-byte XOF. Expected hashes pre-computed via scripts/verify-vectors/src/bin/gen_blake3_large.rs (BLAKE3-team blake3 = "=1.8.5" crate) and embedded verbatim |
9 tests | - |
blake3/blake3-wipe.test.ts |
BLAKE3 wipe coverage (AGENTS.md §Memory and Security): for each public class (BLAKE3, BLAKE3Stream, BLAKE3KeyedHash, BLAKE3KeyedHashStream, BLAKE3DeriveKey, BLAKE3DeriveKeyStream, BLAKE3OutputReader), drive an op (or finalize / dispose), then assert the WASM-side mutable buffer region (MUTABLE_START..BUFFER_END) reads as zero. Pre-poisons the region with 0xa5 between MUTABLE_START and BUFFER_END so the assertion proves wipe definitively zeros (not just initial-empty). Includes explicit KEYED_KEY post-op zero checks | 12 tests | - |
blake3/blake3-validation.test.ts |
BLAKE3 caller-validation gates: wrong key lengths (0 / 31 / 33) throw RangeError; non-Uint8Array key throws TypeError; non-string non-Uint8Array context throws TypeError; empty context throws RangeError (defeats §2.3 domain separation); non-Uint8Array message throws TypeError; outLen edge cases (0, -1, 1.5, NaN, Infinity) throw RangeError; lifecycle guards (update-after-finalize / dispose, finalize-after-dispose, OutputReader read-after-dispose); idempotent dispose | 25 tests | - |
curve25519/gate.test.ts |
curve25519 substrate gate: X25519(alice_sk, bob_pk) against the RFC 7748 §6.1 Alice/Bob shared-secret vector pinned at test/vectors/x25519.ts; [1]B = B against the RFC 8032 §5.1 spec-derived 32-byte canonical compressed basepoint 5866666666666666666666666666666666666666666666666666666666666666; [L]B = identity (the curve order L from RFC 8032 §5.1 Table 1 compressed-encoded as 01000…00) confirming the entire scalar-mult + Edwards-addition + basepoint-constant stack is spec-consistent |
3 tests | GATE |
curve25519/field.test.ts |
GF(2^255-19) field arithmetic invariants over the 5×51-bit limb form: identity (a+0=a, a1=a, a0=0), additive inverse (a+(-a)=0), commutativity of add and mul, distributivity (a*(b+c) = ab+ac), serialisation round-trip (toBytes(fromBytes(x))=x for canonical 32-byte LE inputs with masked bit 255), feInv via the 254-squaring + 11-multiplication Bernstein addition chain (a * inv(a) = 1), constant-time feCondSwap (swap=0 preserves, swap=1 exchanges) | 11 tests | - |
curve25519/scalar.test.ts |
Scalar arithmetic mod L invariants per RFC 8032 §5.1 (curve order L = 2^252 + δ) and RFC 7748 §5 / RFC 8032 §5.1.5 clamp: clamp produces the exact spec shape (low 3 bits zeroed, bit 254 set, bit 255 cleared, middle bytes untouched), scalarIsCanonical at L-1 / L / 0, scalarReduce of zero is zero, scalarReduce(L) = 0, scalarReduce64 of zero is zero, scalarMulAdd identity cases (mulAdd(0,0,c)=c, mulAdd(a,1,0)=a for a<L) | 10 tests | - |
curve25519/scalar_reduce64.test.ts |
scalarReduce64 BigInt-oracle cross-check covering reductions that touch the L-byte path: 2^256 mod L (exercises bytes 14-15 of the L-LE constant), 2^248 / 2^252 (no reduction needed), L itself (one subtraction), and a real SHA-512(prefix) hash output (random 64-byte LE). Regression coverage for the L14 byte transcription error the previous scalar.test.ts could not catch (its only reduce64 case was reduce64(0)=0) |
6 tests | - |
curve25519/edwards.test.ts |
edwards25519 point invariants on extended (X:Y:Z:T) coordinates per RFC 8032 §5.1.4 / Hisil-Wong-Carter-Dawson §3.1 addition formula and §3.2 doubling: identity P+O=P, inverse P-P=O (via edPointSub), abelian P+Q=Q+P, double matches add 2P=P+P, curve membership (-x^2+y^2 = 1 + dx^2y^2 plus the extended-coord invariant XY = ZT) on the basepoint, identity and 8 deterministically-derived points, compression round-trip decompress(compress(P))=P on the basepoint and 8 derived points, decompression rejects random non-residue inputs (≥1 rejection across 32 trials) | 7 tests | - |
curve25519/scalar_mult.test.ts |
Edwards scalar-mult invariants on the straight-line double-and-add loop (no precomputed tables): [0]G=O, [1]G=G, [2]G=double(G), group homomorphism [s+t]G=[s]G+[t]G across 4 deterministic (s, t) pairs in [0, 100000), scalar composition [s][t]G=[st]G across 4 (s, t) pairs in [0, 2^16) (so st fits in 32 bits), fixed-vs-variable-base agreement edPointMulBase(s) == edPointMul(s, B) across 4 random 32-byte scalars | 6 tests | - |
curve25519/montgomery.test.ts |
X25519 Montgomery ladder invariants per RFC 7748 §5. iter=1 sanity vector from test/vectors/x25519.ts (initial k=u=0x09 clamped, one ladder call → 0x422c...); constant-time feCondSwap with swap=0 preserves both field elements byte-for-byte. iter=1000 is deferred to e2e (~1000 ladder calls, slow-path scalar arithmetic exceeds 5-minute unit budget) |
2 tests | - |
curve25519/ed25519_keygen.test.ts |
Ed25519 deterministic keygen (RFC 8032 §5.1.5). Gate: RFC 8032 §7 keygen pairs across 4 §7.1 pure + 1 §7.3 prehash records (5 records, each keygen(skHex) == pkHex). ACVP EDDSA-KeyGen-1.0 corpus (3 records, keygen(seed) == q) |
8 tests | GATE |
curve25519/ed25519_sign.test.ts |
Pure-mode Ed25519 sign (RFC 8032 §5.1.6). Gate: RFC 8032 §7.1 pure records (4 records), each sign(seed, pk, msg) == sigHex byte-for-byte plus self-verify round-trip. ACVP EDDSA-SigGen-1.0 pure subset (preHash === null, 42 records). Includes the §7.1 TEST 1024 case which crosses many SHA-512 blocks |
46 tests | GATE |
curve25519/ed25519_signph.test.ts |
Ed25519ph sign (RFC 8032 §5.1.7 with dom2 phflag=1). SHA-512 of the message computed in the TS test layer (Node crypto.createHash); the WASM accepts a pre-computed digest. Gate: RFC 8032 §7.3 TEST abc (1 record). ACVP EDDSA-SigGen-1.0 prehash subset (preHash === 'SHA-512', 42 records) covering mixed empty / non-empty 0..255-byte contexts |
43 tests | GATE |
curve25519/ed25519_verify.test.ts |
Pure-mode Ed25519 strict verify (RFC 8032 §5.1.7 / FIPS 186-5 §7.6.4). Gate: RFC 8032 §7.1 pure records (4 records, each must verify successfully). ACVP EDDSA-SigVer-1.0 pure subset (5 records) mixed pass / fail per testPassed; failure records exercise the strict-S check, non-canonical-pk path, and other rejection conditions |
9 tests | GATE |
curve25519/ed25519_verifyph.test.ts |
Ed25519ph strict verify (RFC 8032 §5.1.7 prehash). Gate: RFC 8032 §7.3 TEST abc (1 record). ACVP EDDSA-SigVer-1.0 prehash subset (5 records) mixed pass / fail per testPassed
|
6 tests | GATE |
curve25519/x25519_keygen.test.ts |
X25519 deterministic keygen (RFC 7748 §6, basepoint variant). Gate: both halves of the RFC 7748 §6.1 Alice/Bob exchange (keygen(aliceSk) == alicePk, keygen(bobSk) == bobPk), confirming the high-level wrapper applies the RFC 7748 §5 clamp and uses the §4.1 basepoint u-coord (u = 9) |
2 tests | GATE |
curve25519/x25519_dh.test.ts |
X25519 Diffie-Hellman shared-secret agreement (RFC 7748 §6, peer-pk variant). Gate: both directions of the RFC 7748 §6.1 exchange (DH(aliceSk, bobPk) == sharedSecret, DH(bobSk, alicePk) == sharedSecret) verifying symmetry. Internal-consistency: x25519DH agrees with the substrate x25519Ladder on the same (clamped scalar, peer pk) inputs. All-zero shared-secret rejection is enforced at the TS layer, not exercised here |
3 tests | GATE |
curve25519/x25519_iterated.test.ts |
X25519 iterated test (RFC 7748 §5), iter=1000. Initial k = u = 0x09 || 31 zero bytes; each iteration computes next_k = X25519(k, u), then sets u = k (raw pre-clamp) and k = next_k. After 1000 iterations, k must equal the pinned vector 684cf5…2c51. iter=1 is implicitly covered by montgomery.test.ts and the keygen tests; iter=1000000 is deferred per docs/vector_audit.md
|
1 test | - |
p256/gate.test.ts |
p256 substrate gate: [1]G = G against pointBasepoint (SP 800-186 §3.2.1.3); compress(G) against the spec-derived SEC1 §2.3.3 33-byte canonical form 036b17d1f2…d898c296; decompress(compress(G)) = G round-trip; [n]G = identity (the curve order n from SP 800-186 §3.2.1.3) confirming the entire scalar-mult + RCB-addition + basepoint-constant stack is spec-consistent |
4 tests | GATE |
p256/field.test.ts |
GF(p256) field arithmetic invariants over the 8 × u32 saturated-radix form with HMV §2.4.1 Algorithm 2.27 Solinas reduction: a + 0 = a, a + (-a) = 0, associativity, a * 1 = a, a * 0 = 0, a * inv(a) = 1 via Fermat (256-bit binary square-and-multiply over the public constant p-2), distributivity, feFromBytes/feToBytes BE-byte round-trip | 8 tests | - |
p256/scalar.test.ts |
Scalar arithmetic mod n invariants per SP 800-186 §3.2.1.3: scalarIsCanonical at n-1 / n, scalarIsZero, scalarIsHighS at n-1 / 1 (low-S boundary), scalarMul commutativity, scalarInv via Bernstein-Yang safegcd (a * inv(a) = 1), scalarInv stress test across 200 deterministic random + 5 edge-case inputs (eprint 2019/266 §11 substrate coverage), scalarReduce(n) = 0 | 7 tests | - |
p256/point.test.ts |
Renes-Costello-Batina 2016 complete-addition invariants on short-Weierstrass projective coords (a = -3): P + O = P, O + P = P (commutative identity), P + (-P) = O, 2P = P + P (algorithm 6 doubling matches algorithm 4 self-add), P + Q = Q + P (abelian), pointOnCurve(G) and pointOnCurve(G + 2G), compress/decompress round-trip on 3G | 7 tests | - |
p256/scalar_mult.test.ts |
Scalar multiplication invariants on the constant-time double-and-add-always ladder (no precomputed tables): [0]G = O, [1]G = G, [2]G = double(G), pointMulBase(s) = pointMul(s, G) for s ∈ {3, 7, 42} verifying fixed-base agrees with variable-base, group homomorphism [s+t]G = [s]G + [t]G across 4 deterministic (s, t) pairs in [0, 2^31) (sum stays well under n; isolates the additive correspondence from mod-n reduction), scalar composition s = [st]G across 4 (s, t) pairs in [0, 2^16) (so st fits in 32 bits, mod-n reduction stays a no-op) | 6 tests | - |
p256/sha256.test.ts |
Embedded SHA-256 indirect-equivalence smoke test. The substrate's verbatim port of src/asm/sha2/sha256.ts is exercised through the RFC 6979 K-derivation path; direct byte-equivalence is gated by rfc6979.test.ts reproducing the RFC §A.2.5 expected k values. This file confirms deriveK accepts arbitrary 32-byte digests (empty / "a" / "abc" / 64B / 1000B inputs) without crashing |
1 test | - |
p256/hmac_sha256.test.ts |
Embedded HMAC-SHA-256 indirect-equivalence test. Confirms deriveKDeterministic is deterministic for a fixed (d, h1) and that the hedged path with all-zero Z produces a DIFFERENT k from the deterministic path (per draft-irtf-cfrg-det-sigs-with-noise-05 §4's intentional domain separation) | 2 tests | - |
p256/rfc6979.test.ts |
RFC 6979 §3.2 deterministic K derivation against the RFC §A.2.5 P-256 + SHA-256 expected k values (test/vectors/ecdsa_p256.ts, 2 records: 'sample' and 'test'). The deterministic-K gate corpus: ACVP SigGen supplies k explicitly and therefore cannot exercise RFC 6979's k-from-(d, H(m)) derivation; only this test does. Byte-for-byte match against the RFC |
2 tests | GATE |
p256/ecdsa_keygen.test.ts |
ACVP ECDSA-KeyGen-FIPS186-5 P-256 corpus (test/vectors/ecdsa_p256_keygen.ts, tgId=3 'testing candidates' + tgId=4 'extra bits'). For each record: pass d as the seed, ecdsaKeygen derives pk, decompress + affinify, compare (x, y) byte-for-byte against ACVP-supplied (qx, qy) |
6 tests | GATE |
p256/ecdsa_sign.test.ts |
ECDSA sign against RFC 6979 §A.2.5 records (test/vectors/ecdsa_p256.ts). The deterministic-K shortcut (rnd = all-zero) routes through RFC 6979 §3.2 verbatim. Compares against the low-S equivalent of the RFC's published s (the library always emits low-S per RFC 6979 §3.5; the RFC §A.2.5 'sample' record happens to be high-S, 'test' is already low-S) |
2 tests | GATE |
p256/ecdsa_signhedged.test.ts |
Hedged-deterministic ECDSA smoke test. The current ACVP P-256 + SHA-256 corpus contains only componentTest=false records, so no hedged-path KAT is available; this file confirms (1) hedged signatures verify correctly under ecdsaVerify and (2) distinct rnd inputs produce distinct signatures (the whole point of the hedged construction) | 2 tests | - |
p256/ecdsa_verify.test.ts |
ACVP ECDSA-SigVer-FIPS186-5 P-256 + SHA-256 corpus (test/vectors/ecdsa_p256_sigver.ts, 7 records: 'modify r', 'modify message', 'zero r', 'modify s', 'none' (positive control), 'modify key', 'zero s'). Each record is verified through ecdsaVerify; the library's strict-S posture rejects high-S even on otherwise-valid records, so the test reconciles per-record testPassed with the high-S check via BigInt comparison against n/2 |
7 tests | GATE |
p256/ecdsa-pk-uncompressed.test.ts |
TS-layer SEC 1 §2.3.4 uncompressed-pk surface. pointDecompress free function: round-trips the RFC 6979 §A.2.5 compressed pk to the published (Ux, Uy) byte-for-byte and re-compresses back to the original 33-byte input; both parity branches (0x02 / 0x03) round-trip via curve-equation y = ± sqrt mod p; rejects bad-prefix bytes (0x00, 0x04, 0xFF) with SigningError('sig-malformed-input'); deterministic off-curve x search (Euler's criterion via BigInt modPow over P-256 prime, curve b from SP 800-186 §3.2.1.3) produces an x whose y² is a non-residue, both prefix parities reject with SigningError; wrong-length (32 / 34 / 65) inputs raise RangeError, non-Uint8Array raises TypeError. EcdsaP256.keygenUncompressed: 65-byte 0x04-prefixed pk + 32-byte sk; X-coordinate equality with keygenDerand-derived compressed pk for the same seed; reproduces (Ux, Uy) when seeded with the §A.2.5 x; seedless keygen yields distinct keypairs; round-trip through EcdsaP256.sign / verify confirms the validate-pk path accepts the 65-byte form |
12 tests | - |
p256/ecdsa_pk_canonicality.test.ts |
pointDecompress strict x < p canonicality, SEC 1 §2.3.4 + SP 800-186 §3.2.1.3 (P-256). Surfacing test for the malleability gap closed by the explicit feIsCanonical gate inserted after feFromBytes in pointDecompress: feFromBytes is a literal byte loader (no mod-p reduction), so without the gate an adversarial wire x ∈ [p, 2^256) would silently reduce inside the curve-equation feMul / feSqr calls. Four adversarial shapes plus a canonical positive control: trivial overflow (x = 2^256 - 1, all-0xFF bytes), boundary (x = p exactly), reducing-to-on-curve (x = x_small_valid + p, the security-critical case — pointOnCurve cannot distinguish it from the canonical encoding so the rejection MUST come from feIsCanonical; cross-checked by calling feIsCanonical directly on the parsed non-canonical x), and reducing-to-off-curve (x = x_off_curve + p). On-curve and off-curve small-x candidates are found at test time via Euler's criterion over the P-256 prime and the b constant from SP 800-186 §3.2.1.3, restricted to x < 2^256 - p so x + p fits in 32 bytes |
5 tests | GATE |
p256/ecdsa-ecprivatekey-der.test.ts |
RFC 5915 §3 ECPrivateKey DER codec for P-256, strict-DER per X.690 §10. encodeEcPrivateKey emits exactly 51 bytes (SEQUENCE 2 + version 3 + OCTET STRING 34 + parameters [0] EXPLICIT 12) with the secp256r1 OID (1.2.840.10045.3.1.7, SP 800-186 §3.2.1.3) at offsets 41..51; byte-stable across calls; rejects non-Uint8Array (TypeError) and wrong-length scalars (RangeError). decodeEcPrivateKey round-trips the encoder output, decodes the spec-shape DER directly, round-trips 100 deterministic random scalars, accepts the optional publicKey [1] field, and accepts the parameters-omitted minimal form. Strict-DER rejections (Error): non-Uint8Array (TypeError), input under the 7-byte minimum, wrong outer tag (not 0x30), long-form length on outer SEQUENCE / privateKey OCTET STRING / parameters [0] under 128 bytes, outer length mismatch, wrong version tag / length / value, wrong privateKey tag, privateKey OCTET STRING length not 32, parameters [0] containing a non-secp256r1 OID (different length or same length with different bytes), trailing bytes after the optional fields, content extending past the SEQUENCE end |
26 tests | - |
ecdsa/ecdsa_class.test.ts |
EcdsaP256 TypeScript-class smoke tests: pre-init constructor guard mentions init({ p256: ... }); ecdsaP256Init initialises the p256 module; keygenDerand reproduces the RFC 6979 §A.2.5 compressed pk (0x03 prefix from y odd-parity); keygenDerand determinism across calls; keygen returns a fresh 33-byte pk + 32-byte sk; sign with deterministic rnd reproduces the §A.2.5 'test' (r, s) byte-for-byte; sign self-verify round-trips with hedged and deterministic rnd; sign accepts a 65-byte uncompressed pk and the wrapper normalises to compressed; fault-injection trap rethrown as SigningError on mismatched pk; verify true on §A.2.5 'test'; verify false (no throw) on tampered hash / tampered signature / high-S (n - s) / r = 0 / s = 0; _signInternalPk equals sign(sk, derivedPk, hash, rnd) for matching inputs and reproduces §A.2.5 byte-for-byte with deterministic rnd; validatePublicKey accepts 33-byte and 65-byte, rejects 32 / 64 / 66; validateMessageHash rejects 31 / 33 on both sign and verify; validateSignature rejects 63 / 65; non-Uint8Array sk throws TypeError; validateEntropy rejects 31 / 33; idempotent dispose; concurrency-guard rethrows when the p256 module is held by another stateful instance |
27 tests | GATE |
ecdsa/ecdsa_der.test.ts |
ECDSA signature DER ↔ raw r||s codec (RFC 3279 §2.2.3, X.690 §8.3 INTEGER, §8.9 SEQUENCE). Round-trip on 4 deterministic random scalars; leading-zero strip for r = 1; 0x00 sign-pad insertion when the leading content byte's high bit is set; 72-byte longest DER (both components 32 bytes with high bit set), 8-byte shortest DER (r = s = 1). ecdsaSignatureToDer rejects non-Uint8Array (TypeError) and wrong-length raw input (RangeError, 63 / 65). Strict-DER rejection on ecdsaSignatureFromDer (SigningError discriminator sig-malformed-input): non-Uint8Array (TypeError), truncated input (< 8 bytes), wrong outer tag (not 0x30), long-form outer length, length mismatch (trailing / shorter), mismatched inner tag (not 0x02), long-form INTEGER length, zero-length INTEGER, excess leading-zero (non-minimal DER), negative INTEGER (high bit set without sign-pad), INTEGER content > 32 bytes, truncated INTEGER content extending past SEQUENCE, all-zero seven-byte input |
21 tests | - |
ed25519/ed25519_class.test.ts |
Ed25519 TypeScript-class smoke tests: pre-init constructor guard mentions init({ ed25519: ... }); ed25519Init alias initialises the curve25519 module; keygenDerand against RFC 8032 §7.1 TEST 1/2/3 verifying keys; keygen returns fresh 32-byte pk + sk; sign reproduces RFC §7.1 TEST 1 signature byte-for-byte; sign self-verify round-trip; fault-injection trap rethrown as SigningError on mismatched pk; verify true on RFC §7.1 TEST 1; verify false (no throw) on tampered message / tampered signature; signPrehashed / verifyPrehashed against RFC §7.3 TEST abc with Node crypto SHA-512; length / type validation throws (RangeError / TypeError); concurrency-guard rethrows when curve25519 module is held by another stateful instance |
18 tests | GATE |
x25519/x25519_class.test.ts |
X25519 TypeScript-class smoke tests: pre-init constructor guard mentions init({ x25519: ... }); x25519Init alias initialises the curve25519 module; keygenDerand against RFC 7748 §6.1 Alice / Bob public keys; keygen returns fresh 32-byte pk + sk; dh against RFC §6.1 shared secret in both directions (symmetry); KeyAgreementError thrown on small-order peer pk (u=0 and u=1); length / type validation throws (RangeError / TypeError); concurrency-guard rethrows when curve25519 module is held by another stateful instance |
13 tests | GATE |
merkle/sha256-hasher-rfc6962-kat.test.ts |
RFC 9162 §2.1.1 gate KATs for the SHA-256 substrate sourced from transparency-dev/merkle rfc6962/rfc6962_test.go: MTH({}) = SHA-256(), MTH({""}) = SHA-256(0x00), MTH({"L123456"}) = SHA-256(0x00 ‖ "L123456"), internal node SHA-256(0x01 ‖ "N123" ‖ "N456"), plus outputSize / name / wasmModules introspection |
5 tests | GATE |
merkle/memory-storage.test.ts |
MemoryStorage round-trip: monotonic appendLeaf, out-of-order rejection, putNode/getNode/hasNode probes, missing-slot throws, overwrite semantics, level-0 leaf↔node slot aliasing, failed-append leaves size unchanged | 9 tests | - |
merkle/sha256-tree-roundtrip.test.ts |
splitPoint invariant k < n <= 2k for n in 2..1024 plus n<2 rejection; Sha256Tree append + rootHash gates (empty / size-1 / size-2 against hand-derived RFC 9162 §2.1.1 values); inclusion-proof round-trip across every leaf in every size 1..256; past-history inclusion proofs at sizes 7/13/32/50 within a size-64 tree; consistency-proof round-trip across every (oldSize, newSize) in 1..32; contract violations throw (out-of-range leafIndex, out-of-range newSize, oldSize > newSize) |
12 tests | - |
merkle/sha256-tree-inclusion.test.ts |
transparency-dev/merkle testdata/inclusion/ corpus (98 records, pin fefdc92cb8cbf22503f34fe1d106d150a9204370): every record drives verifyInclusionProof, contract-violation throws are caught and folded into the reject outcome, then compared against the record's wantErr flag |
98 tests | - |
merkle/sha256-tree-consistency.test.ts |
transparency-dev/merkle testdata/consistency/ corpus (97 records, same pin): every record drives verifyConsistencyProof with the same contract-violation handling |
97 tests | - |
merkle/proof-verifiers.test.ts |
Free-function verifier rejection matrix: contract-violation throws (negative leafIndex, leafIndex past treeSize, zero treeSize, wrong-sized rootHash, oldSize > newSize, wrong-sized oldRoot / newRoot in the reconstruction path); malformed-proof returns false (wrong-length leafHash, short / extra-step / wrong-byte-length proof, wrong root, proof for wrong leaf); consistency rejections (non-empty proof at equal sizes, mismatched roots at equal sizes, oldSize zero with non-empty new tree, empty proof for distinct non-zero sizes, wrong-length proof step, wrong oldRoot); builder + verifier round-trip parity at size 13 and (5, 13); builders throw on the same contract violations the verifiers throw on | 21 tests | - |
merkle/blake3-hasher-gate.test.ts |
BLAKE3-native Merkle hash KATs (BLAKE3 §2.4 / §2.5): hashEmpty equals BLAKE3() (af1349b9… spec-fixed), hashLeaf(utf8("leaf-0")) equals the recorded size-1 root, Blake3Tree.rootHash() over 1024 deterministic leaves matches the recorded compress4-driven root, outputSize / name / wasmModules introspection, wrong-length hashInternal inputs throw RangeError. Recorded values are independently reproduced by the RustCrypto blake3 = 1.8.5 crate via scripts/verify-vectors/src/merkle_blake3.rs
|
5 tests | GATE |
merkle/blake3-tree-roundtrip.test.ts |
Blake3Tree append + rootHash: empty / size-1 / size-2 gates (against Blake3Hasher.hashLeaf and hashInternal directly), recorded-root parity across every record in merkle_blake3.ts (sizes 0, 1, 2, 4, 7, 1024), contract violations throw (out-of-range leafIndex, out-of-range newSize, oldSize > newSize) |
7 tests | - |
merkle/blake3-tree-inclusion.test.ts |
RFC 9162 §2.1.3 inclusion-proof verification: every leaf in every non-empty record drives verifyInclusionProof with Blake3Hasher, and Blake3Tree.getInclusionProof reproduces every recorded proof step byte-for-byte. Tampered-step rejection at size 7 closes out the matrix |
6 tests | - |
merkle/blake3-tree-consistency.test.ts |
RFC 9162 §2.1.4 consistency-proof verification: every recorded (fromSize, treeSize) pair drives verifyConsistencyProof with Blake3Hasher, and Blake3Tree.getConsistencyProof reproduces every recorded proof step byte-for-byte. Swapped-root pair rejection at size 7 closes out the matrix |
5 tests | - |
merkle/checkpoint-gate.test.ts |
GATE: c2sp.org/tlog-checkpoint §Note text canonical body codec. Reproduces the example.com/behind-the-sofa worked example byte-for-byte through serializeCheckpointBody and round-trips it through parseCheckpointBody; remaining records (empty tree, single-leaf, Number.MAX_SAFE_INTEGER tree size) drive serialize / parse round-trip. Vectors at test/vectors/merkle_checkpoint.ts, Rust oracle at scripts/verify-vectors/src/merkle_checkpoint.rs
|
10 tests | GATE |
merkle/checkpoint-parse-errors.test.ts |
Rejection paths for serializeCheckpointBody (empty origin, embedded newline, whitespace, plus, negative / non-integer / >MAX_SAFE_INTEGER tree size) and parseCheckpointBody (empty input, missing trailing LF, extension lines, fewer than 3 lines, embedded ASCII control bytes, leading-zero / non-decimal tree size, URL-safe / unpadded / wrong-length base64 root hash, tree-size 0 accepts) per c2sp.org/tlog-checkpoint §Note text |
20 tests | - |
merkle/signed-note-emit.test.ts |
Round-trip coverage for emitSignedNote / parseSignedNote over the three corpus records (1 Ed25519, 1 ML-DSA-44, 2 mixed cosignatures). Asserts envelope SHA-256 against the frozen expectedEnvelopeSha256Hex value, byte-for-byte body recovery, signature-line tuple parity, and emit rejection paths (body without trailing LF, empty signatures, wrong-size keyId, name with whitespace) |
7 tests | - |
merkle/signed-note-parse.test.ts |
Parses the verbatim c2sp.org/signed-note §Format example and the c2sp.org/tlog-cosignature §Format example: asserts signature-line decomposition, key-ID extraction (4 bytes), Ed25519 / timestamped-Ed25519 sig payload lengths (64 / 72), and that the body region excludes the blank-line separator while preserving the body's trailing newline | 3 tests | - |
merkle/signed-note-parse-errors.test.ts |
Whole-envelope rejection (empty input, ASCII control bytes including DEL, no blank-line separator, no signature line after separator, signature region missing trailing LF, blank line inside signatures) and per-line ignored paths (missing em-dash prefix, base64 payload < 4 bytes, malformed / URL-safe base64, empty key name, missing name-base64 separator, plus in name); ignored lines increment ignoredCount rather than throw |
15 tests | - |
merkle/key-id-derivation.test.ts |
deriveKeyId KATs per c2sp.org/signed-note §Signatures and c2sp.org/tlog-cosignature §Format: spec-anchored Ed25519 0x01 example (example.com/foo → 530d903a), self-generated Ed25519 0x04 and ML-DSA-44 0x06 cases; rejection paths (empty / whitespace / plus in name, out-of-range algo byte); suiteFormatEnumToAlgoByte registry asserts Ed25519Suite → 0x04, MlDsa44Suite → 0x06, unregistered enums return undefined |
11 tests | - |
merkle/signed-note-unknown-sig.test.ts |
Forward-compatibility for parseSignedNote: a signed note with one valid Ed25519 cosignature line plus one structurally-foreign "future algorithm" line parses successfully, returning the known line in signatures and counting the unknown one in ignoredCount. Multi-line accumulation tested with three synthetic unknown lines after one known line |
2 tests | - |
merkle/cosig-message-gate.test.ts |
GATE: c2sp.org/tlog-cosignature §"Ed25519 signed message" construction. Reproduces the spec worked example byte-for-byte via buildCosigSignedMessage(body, 1679315147); remaining records (timestamp 0, timestamp 1, Number.MAX_SAFE_INTEGER) cover the byte-stable layout, plus rejection paths (body without trailing LF, non-Uint8Array body, negative / non-integer / >MAX_SAFE_INTEGER timestamps via MerkleCodecError('timestamp-out-of-range')). Vectors at test/vectors/cosig_message.ts, Rust oracle at scripts/verify-vectors/src/merkle_cosig.rs
|
10 tests | GATE |
merkle/cosig-payload-roundtrip.test.ts |
Round-trip coverage for the c2sp.org/tlog-cosignature §Format timestamped_signature payload codec across 6 records (Ed25519 sigSize=64 with timestamps 0/1/1679315147/MAX_SAFE_INTEGER, ML-DSA-44 sigSize=2420 with timestamps 0/1679315147). For each: emit produces the recorded payloadHex, parse recovers (timestamp, signature), emit-then-parse and parse-then-emit both byte-equal the input |
24 tests | - |
merkle/cosig-payload-parse-errors.test.ts |
Rejection paths for parseCosigSignaturePayload and emitCosigSignaturePayload per c2sp.org/tlog-cosignature §Format: payload length mismatches (too short / too long / sigSize argument disagrees with payload), u64 timestamps exceeding Number.MAX_SAFE_INTEGER (high32 ≥ 0x200000) throw MerkleCodecError('timestamp-exceeds-safe-integer'), the 2^53 boundary is enforced exclusive and 2^53 - 1 is accepted; emit-side timestamp-out-of-range on negative / non-integer / >MAX_SAFE_INTEGER, plus TypeError on non-Uint8Array inputs and RangeError on non-integer / negative sigSize |
14 tests | - |
merkle/timestamp-encoding.test.ts |
RFC 8446 §3.3 big-endian u64 encoding KAT inside emitCosigSignaturePayload: epoch 0, 1, 0xff, 0xffffffff, the 32-bit boundary 2^32, the c2sp.org/tlog-cosignature §Format spec example 1679315147 → 00 00 00 00 64 18 50 cb, and Number.MAX_SAFE_INTEGER → 00 1F FF FF FF FF FF FF
|
7 tests | - |
merkle/cosigned-message-gate.test.ts |
GATE: c2sp.org/tlog-cosignature §"ML-DSA-44 signed message" cosigned_message TLS-Presentation struct. Reproduces the spec worked-example bytes via buildCosignedMessage; locks the 12-byte subtree/v1\n\0 label, the minimal-input layout (70 + cosigner_name.len + log_origin.len), and the four spec branches (log self-cosignature, witness, no-statement, subtree). Rejection paths cover safe-integer guards on timestamp / start / end, 1..255 length bounds on UTF-8 cosigner_name and log_origin, 32-byte hash length, and the spec MUST that start != 0 requires timestamp == 0. Vectors at test/vectors/cosigned_message.ts, Rust oracle at scripts/verify-vectors/src/merkle_cosig.rs
|
20 tests | GATE |
merkle/signed-log-gate.test.ts |
GATE: end-to-end SignedLog wire format per c2sp.org/tlog-cosignature §Format. Reproduces the V1 record from sign_sth_ed25519.ts byte-for-byte via SignedLog<Ed25519Suite>.signCheckpoint (the V1 cosignature signed-message, the keyId, the timestamped_signature payload, and the full signed-note envelope are all locked) and confirms verifyCheckpoint accepts the recorded envelope. Vectors at test/vectors/sign_sth_ed25519.ts, Rust oracle at scripts/verify-vectors/src/sign_sth.rs
|
2 tests | GATE |
merkle/signed-log-roundtrip-ed25519.test.ts |
SignedLog<Ed25519Suite> sign + verify roundtrip across every record in sign_sth_ed25519.ts (3 records). Each record: signCheckpoint reproduces the recorded envelope bytes byte-for-byte (Ed25519 is deterministic per RFC 8032 §5.1.6), verifyCheckpoint accepts the recorded envelope, parseCheckpoint surfaces the recorded timestamp / origin / treeSize / rootHash, and the envelope decomposes into the recorded body + timestamped_signature payload (with the inner sig bytes matching) |
12 tests | - |
merkle/signed-log-roundtrip-mldsa44.test.ts |
SignedLog<MlDsa44Suite> verify + production-hedged-sign roundtrip across every record in sign_sth_mldsa44.ts (3 records). The recorded envelopes are byte-stable (generated via MlDsa44.signDeterministic over the cosigned_message); each record: verifyCheckpoint accepts the recorded envelope, the production hedged signCheckpoint produces a different (also valid) envelope per FIPS 204 §3.4, parseCheckpoint surfaces the timestamp / origin / treeSize / rootHash, and the envelope decomposes into the recorded body + timestamped_signature payload |
12 tests | - |
merkle/signed-log-verify-failures.test.ts |
Soft-fail paths for SignedLog<Ed25519Suite>.verifyCheckpoint: forged sig from a third-party key (keyId mismatch suppresses the line), flipped body byte (envelope reparses but signed-message reconstructs differently), tampered timestamp inside the cosig payload (re-emitted envelope fails the suite.verify call), flipped signature byte, cross-log envelope (origin mismatch), wrong-pubkey verifier (keyId derivation mismatch), wholly malformed envelopes (empty, garbage, non-signed-note text) |
7 tests | - |
merkle/signed-log-unsupported-suite.test.ts |
SignedLog constructor rejects every catalog SignatureSuite whose formatEnum lacks a C2SP cosignature byte. Covers EcdsaP256Suite (C2SP 0x02 is ECDSA-witness with DER encoding, not P1363 r||s), Ed25519PreHashSuite / MlDsa44PreHashSuite (no C2SP cosig bytes for prehash variants), MlDsa65Suite / MlDsa87Suite (only ML-DSA-44 is registered), SlhDsa128fSuite (no SLH-DSA bytes), and both hybrid families. Throws SigningError('sig-unsupported-suite') with a message naming the suite and pointing at the C2SP spec |
8 tests | - |
merkle/signed-log-extension-lines.test.ts |
Phase 7 extension-line policy per c2sp.org/tlog-cosignature §"ML-DSA-44 signed message" ("checkpoint extension lines are not included in the signed message for ML-DSA-44 cosignatures"). SignedLog.signCheckpoint emits a body with exactly 3 lines (no extensions); parseCheckpointBody rejects hand-crafted bodies with extension lines; verifyCheckpoint returns false on a tampered envelope whose body carries extension lines |
3 tests | - |
merkle/merkle-verifier-gate.test.ts |
GATE: end-to-end MerkleLog + MerkleVerifier handshake. Builds a MerkleLog<Ed25519Suite> from a fixed seed, appends three deterministic leaves, captures the head envelope and an inclusion proof for the middle leaf, then verifies through a freshly constructed MerkleVerifier with the same identity. Asserts verifyCheckpoint, verifyInclusion, and verifyConsistency all return true. Any byte drift in checkpoint serialization, cosignature signed-message construction, signed-note emit, key-ID derivation, or RFC 9162 §2.1.3 inclusion-proof verification breaks this gate |
2 tests | GATE |
merkle/merkle-verifier-footguns.test.ts |
Documented soft-fail returns false (never throw on verify content) plus construction-time MerkleLogError throws. Soft-fail: wrong pubkey (keyId mismatch), wrong origin (body origin line mismatch), tampered envelope byte, tampered proof byte, off-by-one leafIndex (RFC 9162 §2.1.3 chain-bit dispatch), wrong leaf bytes (re-hashed leaf does not match position), tampered envelope under verifyInclusion, wholly malformed input. Construction throws: unregistered suite (EcdsaP256Suite), wrong-length pubkey, origin with whitespace or plus |
11 tests | - |
merkle/merkle-log-roundtrip.test.ts |
Cartesian product roundtrip: {sha256, blake3} × {Ed25519Suite, MlDsa44Suite} × {small (3 leaves), medium (13 leaves)}. Each case appends leaves in two snapshots, builds inclusion proofs for every leaf and a consistency proof between the two snapshots, then verifies all three properties through a fresh MerkleVerifier. Locks the full normie surface against both supported hash families and both C2SP-registered cosignature suites |
8 tests | - |
merkle/merkle-log-keygen.test.ts |
MerkleLog.generate keypair shape (returned signingKey.length === suite.skSize, pubkey.length === suite.pkSize) for Ed25519Suite and MlDsa44Suite, plus smoke verification that the returned keys drive a checkpoint that MerkleVerifier accepts. Default-resolution coverage: suite defaults to MlDsa44Suite (observed via pkSize), hashing defaults to 'sha256' (observed via log.hasher.name). Unsupported-suite throw paths: MerkleLog.create and MerkleLog.generate both reject EcdsaP256Suite, MlDsa65Suite, SlhDsa128fSuite, and an unknown hashing string with MerkleLogError
|
9 tests | - |
mlkem/poly_arithmetic.test.ts |
Gate-based WASM primitive tests: instantiation + buffer layout, Montgomery reduce, Barrett reduce, fqmul, zetas verification, NTT roundtrip, basemul commutativity, serialization roundtrip, compression bounds, message encode/decode, rejection sampling, CBD bounds, CT verify/cmov | 47 tests | Gates 1-6 |
mlkem/ntt_simd_gate.test.ts |
SIMD NTT/poly gate: ntt_simd byte-identical to ntt_scalar (100 random polys), invntt_simd byte-identical to invntt_scalar (100 random polys), roundtrip identity, poly_add/sub/reduce match scalar semantics, poly_ntt/invntt match |
11 tests | Gates 1-2 |
mlkem/mlkem.test.ts |
ML-KEM ACVP validation: init system wiring, IND-CPA keygen (all 3 param sets), encapsulation, valid decapsulation, implicit rejection, encapsulation-key validation, decapsulation-key validation, round-trip property, implicit-rejection property. 240 NIST ACVP vectors | 332 tests | Gates 0-9 |
mlkem/mlkem_suite.test.ts |
MlKemSuite integration: all 9 parameter pairings (MlKem512/768/1024 × XChaCha20/Serpent/AES-GCM-SIV), param-set key-size invariants, error cases (mismatched ek/dk, wrong cipher key, post-dispose use) |
68 tests | - |
mlkem/suite-commitment.test.ts |
MlKemSuite salamander mitigation forwarding: commitmentSize is 32 for MlKemSuite(*, XChaCha20Cipher) and MlKemSuite(*, AESGCMSIVCipher) and 0 for MlKemSuite(*, SerpentCipher); format-enum cross-product including AES variants 0x14/0x24/0x34; wasmModules covers aes/sha2/mlkem/sha3 for AES variants; Seal.encrypt/decrypt round-trip with KEM + commitment preamble; tampered commitment fails fast with commitment-mlkem768+xchacha20 and commitment-mlkem768+aes-gcm-siv; OpenStream over a tampered MlKemSuite preamble throws on construction; cross-suite negative test (xchacha20 blob does not decrypt under aes-gcm-siv suite) |
15 tests | - |
mlkem/keygen-scratch-wipe.test.ts |
kemKeypairDerand, scratch slots wiped after keygen across all parameter sets |
6 tests | - |
mlkem/encap-scratch-wipe.test.ts |
kemEncapsulateDerand, scratch slots wiped after encap across all parameter sets |
8 tests | - |
mlkem/decap-scratch-wipe.test.ts |
kemDecapsulate, scratch slots wiped after decap across all parameter sets (regression for residual sharedSecret/ciphertext bytes) |
9 tests | - |
mlkem/sha3-scratch-wipe.test.ts |
sha3 scratch wiped after every public mlkem op; belt-and-suspenders across param sets; checkDecapsulationKey length-gate early return does NOT need to reach the sha3 wipe |
9 tests | - |
ratchet/ratchet_kdf.test.ts |
ratchetInit KDF_SCKA_INIT (HKDF-SHA-256) + KDFChain: KAT vector sweep (6 sk/context combos), nextChainKey propagation, dispose guards, input guards (sk length, ck length, counter overflow), context-isolation, ratchetReady() and uninitialized-sha2 throws |
23 tests | GATE |
ratchet/kem_ratchet.test.ts |
kemRatchetEncap/kemRatchetDecap KDF_SCKA: ACVP-derived sharedSecret gate, kemCt length invariant, context isolation, direction symmetry (alice.send === bob.recv), round-trip nextRootKey match |
5 tests | GATE |
ratchet/kem-ratchet-info-binding.test.ts |
KEM-ratchet HKDF info-string binding: (peerEk, kemCt, context) defense-in-depth on top of FO transform; flipping any byte produces a different nextRootKey
|
5 tests | - |
ratchet/skipped_key_store.test.ts |
SkippedKeyStore: happy-path commit, rollback, rollback + legitimate delivery, wipeAll, resolve() argument validation, settle guards (double-settle throws, key access after settle throws), key lifecycle, split budgets (maxCacheSize, maxSkipPerResolve) |
25 tests | - |
ratchet/resolve-handle-dos-mitigation.test.ts |
DoS-mitigation: rollback() returns the key to the store under the same counter so a later legitimate delivery at that counter can still decrypt; bounded HKDF work via maxSkipPerResolve
|
2 tests | - |
ratchet/ratchet_keypair.test.ts |
RatchetKeypair: round-trip keygen/decap, single-use guard (second decap throws), dispose() is idempotent, context round-trip |
8 tests | - |
mldsa/reduce.test.ts |
ML-DSA reduction primitives (FIPS 204 Algorithm 49 + §2.3): Montgomery reduce on hand-verified inputs (0, q·2³², 2³², q−1, ±2³¹·q boundary) + 100 random i64 inputs (congruence + | r | <2q bound), centered Barrett reduce on boundary/extreme/200 random i32 inputs, fqmul ≡ montgomery_reduce(a·b) cross-check |
mldsa/ntt_simd_gate.test.ts |
ML-DSA NTT (FIPS 204 Algorithms 41/42/43): SIMD ntt byte-identical to ntt_scalar for zero / delta-at-42 / all-ones / 100 random polys; SIMD invntt byte-identical to invntt_scalar for 100 random NTT-domain polys; round-trip identity (SIMD and scalar) invntt(ntt(p)) ≡ p (mod q) over 100 random polys; BitRev₈ fixed points, zetas[0]=0 (unused), zetas[128] decodes to ζ=1753, full 256-entry zetas table self-check vs ζ^BitRev₈(k)·2³² mod q |
11 tests | GATE |
mldsa/poly_arithmetic.test.ts |
ML-DSA polynomial arithmetic (FIPS 204 §7.6 Algs 44-45 + §2.3): poly_add/sub coefficient-wise sum/diff over 30 random polys, poly_reduce centered Barrett (output in [-(q-1)/2, (q-1)/2] and ≡ input mod q), poly_caddq canonicalisation to [0, q-1] over hand-picked boundary cases, poly_pointwise_montgomery vs montgomery_reduce(a·b) per coefficient, NTT round-trip identity invntt(NTT(a) ◦ tomont(NTT(b))) ≡ schoolbook(a, b) mod (X²⁵⁶+1) mod q, poly_chknorm boundary tests |
9 tests | GATE |
mldsa/encoding.test.ts |
ML-DSA bit-pack / hint-pack (FIPS 204 §7.1 Algs 16-21): simple_bit_pack/unpack round-trips at widths {3, 4, 6, 10, 13, 18, 20}; bit_pack/unpack round-trips for η=2 (bitlen 3), η=4 (bitlen 4), t0 (bitlen 13), z@γ₁=2¹⁷ (bitlen 18), z@γ₁=2¹⁹ (bitlen 20); hint_bit_pack/unpack round-trip with k=4, ω=80, sparse hints; three SUF-CMA-critical malformed-input checks (FIPS 204 §D.3): y[ω+i] regression below Index → -1, y[ω+i] > ω → -1, non-strict ascending positions in same poly → -1, trailing nonzero byte in [Index, ω) → -1; empty-hint round-trip | 18 tests | GATE |
mldsa/rounding.test.ts |
ML-DSA rounding kernels (FIPS 204 §7.4 Algs 35-40): power2round identity r ≡ r1·2^d + r0 (mod q) with r0 ∈ (-2^(d-1), 2^(d-1)] over boundary + random; decompose identity r ≡ r1·2γ₂ + r0 (mod q) for both γ₂ ∈ {(q-1)/88, (q-1)/32}; highbits == decompose.r1 and lowbits == decompose.r0 cross-check; make_hint definition h = [[HighBits(r) ≠ HighBits(r+z)]]; use_hint round-trip use_hint(make_hint(z, w-z), w-z) == HighBits(w) for small z |
6 tests | GATE |
mldsa/sampling.test.ts |
ML-DSA rejection sampling (FIPS 204 §7.3 Algs 29-31): rej_ntt_poly hand-crafted byte stream + 1024 random bytes vs independent CoeffFromThreeBytes scan + resumable two-call ctr accumulation; rej_bounded_poly η=2 acceptance set matches 2 − (b mod 5) for b<15, η=4 acceptance set matches 4 − b for b<9, range bounds [-η, η] enforced; sample_in_ball produces exactly τ ±1 coefficients for τ ∈ {39, 49, 60} with rest zero; resumable shape returning <N continues correctly with fresh bytes |
9 tests | GATE |
mldsa/mldsa.test.ts |
Pure-ML-DSA keyGen / sigGen / sigVer ACVP gates (FIPS 204 §6.1 Alg 6, §6.2 Alg 7, §6.3 Alg 8 + Algs 22/24/26/27): pre-init guard, init({ mldsa, sha3 }) registers both modules, MlDsa44/65/87 construct, keygen() returns expected pkBytes/skBytes, keygenDerand rejects non-32-byte seeds, byte-identical pk/sk for ML-DSA-44 tcId=1; full ACVP keyGen-FIPS204 corpus (75 AFT); first-vector deterministic external/pure sigGen byte match, full sigGen external/pure corpus across 44/65/87 (90 tests, deterministic + signDerand); first-vector sigVer, full sigVer external/pure corpus including known-fail cases (45 tests); round-trip keygen→sign→verify with hedged + deterministic + tampered + ctx-bound across all parameter sets. HashML-DSA gates 8/9/10 live in hashvariant.test.ts
|
230 tests | Gate 0/1/2/3/4/5/6/7 |
mldsa/mldsa_siggen_kats.test.ts |
ACVP §6.1.2 Sign_internal rejection-path and high-rejection-count KATs (FIPS 204 §6.2 Alg 7). Per record: keygenDerand(seed) reproduces (pk, sk) with SHA2-256(pk‖sk) matching the spec, and mldsaSignInternal(sk, M′, 0³²) produces σ with SHA2-256(σ) matching the spec. Table 1 covers each rejection branch (` |
z | , |
mldsa/keygen-scratch-wipe.test.ts |
ML-DSA keygen scratch wipes: SEED_OFFSET (ρ‖ρ′‖K, 128 B) zero, TR_OFFSET (tr, 64 B) zero, XOF_PRF_OFFSET (8 KiB) zero. Per-parameter-set polyvec wipes, POLYVEC_SLOT_0 (s₁ time-domain, ℓ × 1024 B), POLYVEC_SLOT_1 (s₂ k × 1024 B), POLYVEC_SLOT_2 (t intermediate), POLYVEC_SLOT_4 (t₀ secret), POLYVEC_SLOT_5 (ŝ₁ NTT/Montgomery copy), SK_OFFSET (encoded sk, parameter-set-dependent length). Pre-dirty-then-keygen confirms wipe definitively zeros, not just initial-empty | 22 tests | GATE |
mldsa/sign-scratch-wipe.test.ts |
ML-DSA sign scratch wipes (FIPS 204 §3.6.3 Intermediate Values): all 6 polyvec slots (ŝ₁/ŝ₂/t̂₀ in tomont, plus per-iter y / ⟨cs₁⟩ / ⟨cs₂⟩ / ⟨ct₀⟩ / w − ⟨cs₂⟩ / r₀ / z / h) zero, all 8 poly slots zero (signs / c / acc-scratch), XOF/PRF (8 KiB) zero, SEED/TR/SK/C_TILDE/MSG_REP regions zero (defensive). Pre-dirty-then-sign across 44/65/87 confirms wipe definitively zeros. Spot-checks for signDeterministic / signDerand / signHash / signHashDeterministic / signHashDerand across SHA2-256, SHA3-512, SHAKE128, SHA2-512 prehashes | 33 tests | GATE |
mldsa/verify-scratch-wipe.test.ts |
ML-DSA verify scratch wipes: 5 polyvec slots zero, 8 poly slots zero, XOF/PRF zero. Covers success path, tampered-σ failure path, malformed-hint failure path across 44/65/87, and verifyHash with SHA2-256 / SHA3-512 / SHAKE256 prehashes, same wipe must fire on every return path | 18 tests | GATE |
mldsa/validate-checks.test.ts |
ML-DSA caller-validation gates (FIPS 204 §3.6.2 + §5.2/§5.3 line 1 + §D.3): wrong-length sk → sign throws RangeError; wrong-length pk/σ → verify returns false (not throw); ctx > 255 bytes → throw across all 4 entry points; 255-byte ctx round-trip works; empty-ctx default; wrong-length rnd in signDerand throws; HintBitUnpack three malformed-input checks (Alg 21 lines 4, 9, 17) each individually rejected | 17 tests | GATE |
mldsa/sha3-scratch-wipe.test.ts |
sha3 STATE/INPUT/OUT regions wiped after every public mldsa op. Confirms keygen(), keygenDerand, sign, signDeterministic, signDerand, verify, signHash (SHA3-256 / SHAKE128 / SHAKE256 / SHA2-256 prehashes), and verifyHash (SHA3-512 success + SHA2-512 failure) for MlDsa44/65/87 all leave sha3 scratch zero, no μ / ρ'' / K / ρ′ / c̃-derived bytes leak through SHAKE state across op boundaries |
19 tests | GATE |
mldsa/sha2-scratch-wipe.test.ts |
sha2 STATE/INPUT/OUT regions wiped after every HashML-DSA op with a SHA-2 family pre-hash. signHash for each of {SHA2-224, SHA2-256, SHA2-384, SHA2-512, SHA2-512/224, SHA2-512/256}; verifyHash success + failure paths; signHashDeterministic / signHashDerand spot-checks; pre-dirty-then-op confirms wipe definitively zeros; inverse-discipline check that signHash(SHAKE128) does NOT touch sha2 buffers (sentinel preserved), confirms the optional-sha2 design |
12 tests | GATE |
mldsa/hashvariant.test.ts |
HashML-DSA suite, FIPS 204 §5.4 Algorithms 4 & 5. Round-trip signHash → verifyHash for all 36 (paramSet, prehash) tuples; ACVP HashML-DSA sigGen byte-equality (90 vectors via signHashDerand / signHashDeterministic across SHA2-{224,256,384,512,512/224,512/256}, SHA3-{224,256,384,512}, SHAKE-{128,256}); ACVP HashML-DSA sigVer (45 vectors including known-fail) verdicts; cross-protocol separation (sign ↔ verifyHash mutually distinct, mismatched prehash → false, mismatched ctx → false); validate gates: wrong-length sk / pk / σ, oversize ctx, wrong-length rnd, unsupported prehash → throw RangeError |
219 tests | Gate 8/9/10 |
mldsa/mldsa-prehashed.test.ts |
HashML-DSA prehashed-input surface (signHashPrehashed, signHashPrehashedDeterministic, signHashPrehashedDerand, verifyHashPrehashed). Re-oracle ACVP HashML-DSA sigGen vectors (90 vectors, externally-computed PH → byte-identical signatures) and sigVer (45 vectors, including known-fail) through the prehashed entry points; hedged round-trip across all 36 (paramSet, prehash) tuples; equivalence with non-prehashed family (signHashDeterministic ≡ signHashPrehashedDeterministic when digest = Hash(M, ph), byte-identical); sign-side SigningError('sig-malformed-input') on wrong-size digest, verify-side returns false (structural mismatch, no throw); length / contract errors mirror non-prehashed family |
222 tests | - |
slhdsa/slhdsa-address.test.ts |
SLH-DSA ADRS structure (FIPS 205 §4.2): all seven address-type setters (setType, setLayer, setTree, setKeyPair, setChain, setHash, setTreeIndex, setTreeHeight), field-width invariants, type-pinning across the WOTS / FORS / Tree-hash address variants, ADRS zeroing between hash calls |
32 tests | - |
slhdsa/slhdsa-hashes.test.ts |
SLH-DSA internal hash primitives (FIPS 205 §11.2.1 SHAKE construction): F / H / T_l absorbance shape, PRF / PRFmsg / Hmsg domain separation across parameter sets, output-length pinning to n bytes for F/H/T_l and m bytes for Hmsg, ADRS hash output independence | 21 tests | - |
slhdsa/slhdsa-wots.test.ts |
SLH-DSA WOTS+ one-time-signing (FIPS 205 §5): wotsChain, wotsPkGen, wotsSign, wotsPkFromSig across all three parameter sets; secret-key generation from (SK.seed, ADRS) via PRF; signature length = lg(w)·n bytes; PK round-trip (sign then recover-pk matches direct keygen) |
23 tests | GATE |
slhdsa/slhdsa-fors.test.ts |
SLH-DSA FORS few-time-signing (FIPS 205 §8): forsSkGen, forsTreeHash, forsSign, forsPkFromSig across all three parameter sets; per-leaf authentication-path verification; signature length = k·(a+1)·n bytes; secret-key derivation from (SK.seed, ADRS) via PRF; PK round-trip |
18 tests | - |
slhdsa/slhdsa-xmss.test.ts |
SLH-DSA XMSS sub-tree (FIPS 205 §6 / §10.3): xmssNode, xmssSign, xmssPkFromSig across all three parameter sets; tree-hash composition with WOTS+ leaves; authentication-path encoding; cross-checks xmss_node(0) against the recursive Algorithm 9 reference |
21 tests | - |
slhdsa/slhdsa-hypertree.test.ts |
SLH-DSA HT hyper-tree (FIPS 205 §7 / §10.3): htSign, htVerify across all three parameter sets; d-layer XMSS composition; round-trip (sign → verify true; tamper any byte → verify false); upper-tree authentication-path encoding |
30 tests | - |
slhdsa/slhdsa.test.ts |
Pure SLH-DSA keyGen / sign / verify gate (FIPS 205 §10.1 Algorithm 21 / §10.2.1 Algorithm 22 / §10.3 Algorithm 24): pre-init guard, init({ slhdsa }) registers the module, SlhDsa128f/192f/256f construct, keygen() returns expected pkBytes/skBytes, keygenDerand rejects non-3n-byte seeds, byte-identical pk/sk for a deterministic seed; hedged / deterministic / derand round-trips across the three parameter sets; tamper rejection; ctx round-trip; wrong-length pk/σ verdicts |
24 tests | Gate 0/1/2/3/4/5/6/7 |
slhdsa/keygen-scratch-wipe.test.ts |
SLH-DSA keygen scratch wipes: INPUT (SK.seed ‖ SK.prf ‖ PK.seed) wiped after keygen() / keygenDerand(); wipeBuffers() zeros the staging region across all parameter sets; pre-dirty-then-keygen confirms wipe definitively zeros, not just initial-empty |
4 tests | - |
slhdsa/sign-scratch-wipe.test.ts |
SLH-DSA sign scratch wipes: ADRS / WOTS / FORS / Tree-hash scratch regions zero after every signing path (hedged / deterministic / derand). Pre-dirty-then-sign confirms wipe definitively zeros across SlhDsa128f / 192f / 256f
|
6 tests | - |
slhdsa/verify-scratch-wipe.test.ts |
SLH-DSA verify scratch wipes: ADRS / WOTS / FORS / Tree-hash scratch regions zero after every verify path (success and tamper-fail) across SlhDsa128f / 192f / 256f. Same wipe must fire on every return path |
6 tests | - |
slhdsa/slhdsa-prehashed.test.ts |
HashSLH-DSA prehashed-input surface (signHashPrehashed, signHashPrehashedDeterministic, signHashPrehashedDerand, verifyHashPrehashed). Round-trip across (paramSet, prehash) tuples that satisfy the FIPS 205 §10.2.2 category-1 restriction on SHA2-256 / SHAKE128; equivalence with non-prehashed family (signHashDeterministic ≡ signHashPrehashedDeterministic when digest = Hash(M, ph), byte-identical); sign-side SigningError('sig-malformed-input') on wrong-size digest, verify-side returns false (structural mismatch); length / contract errors mirror non-prehashed family |
98 tests | - |
slhdsa/slhdsa-hashvariant.test.ts |
HashSLH-DSA full surface, FIPS 205 §10.2.2 Algorithm 23 / §10.3 Algorithm 25. Round-trip signHash → verifyHash for every (paramSet, prehash) tuple permitted by §10.2.2 category-1 restriction; OID-DER prefix binding into M' across all 12 approved pre-hash functions; cross-protocol separation (pure ↔ HashSLH-DSA mutually distinct, mismatched prehash → false, mismatched ctx → false); category-mismatch guard throws RangeError when SHA2-256 / SHAKE128 is paired with category-3 / category-5 keys |
108 tests | - |
slhdsa/slhdsa-validation.test.ts |
SLH-DSA caller-validation gates (FIPS 205 §3.6.2 + §10.2.2 §10.3 line 1): wrong-length sk → sign throws RangeError; wrong-length pk/σ → verify returns false (not throw); ctx > 255 bytes → throw across all entry points; 255-byte ctx round-trip works; empty-ctx default; wrong-length optRand in signDerand throws; unsupported prehash → RangeError; HashSLH-DSA category-1 restriction violation → RangeError | 30 tests | - |
slhdsa/slhdsa-acvp.test.ts |
SLH-DSA ACVP corpus (FIPS 205 §10.1 Algorithm 21 / §10.2.1 Algorithm 22 / §10.3 Algorithm 24): full keyGen / sigGen / sigVer corpora across SLH-DSA-SHAKE-128f / 192f / 256f, deterministic / hedged / signDerand modes, byte-identical to published NIST ACVP vectors. The slowest of the SLH-DSA primitive tests; isolated in its own CI group | 93 tests | GATE |
sign/sign-types.test.ts |
v3 sign type contracts: SignatureSuite / StreamableSignatureSuite field shapes pin formatEnum / formatName / ctxDomain / pkSize / skSize / sigMaxSize / wasmModules; pure-mode catalog bytes (0x03-0x05) carry only SignatureSuite; prehash bytes (0x13-0x15) carry StreamableSignatureSuite with prehashAlgorithm and prehashSize; PrehashAlgorithm union covers all six identifiers; SignatureSuite-only suites refuse SignStream at the type layer |
8 tests | - |
sign/sign-errors.test.ts |
SigningError discriminator-first constructor: 12 discriminator strings round-trip through message and discriminator; default message format, instanceof Error, prototype chain, custom message override, distinct from AuthenticationError
|
8 tests | - |
sign/sign-ctx.test.ts |
ctx-domain wiring: buildEffectiveCtx length-prefix construction (suite ctxDomain ‖ user_ctx with 1-byte prefixes), USER_CTX_MAX absolute cap throws SigningError('sig-ctx-too-long'), combined effective_ctx > 255 (FIPS 204 §3.6.1) throws the same discriminator, CTX_DOMAIN_MAX factory cap throws plain Error, empty user_ctx is legal, ctxDomain immutability across calls, prehashAlgoToMldsa bridge covers all six PrehashAlgorithm values |
15 tests | - |
sign/sign-envelope.test.ts |
Sign envelope wire format (single-shot path): Sign.sign produces the documented suite_byte ‖ ctx_len ‖ ctx ‖ payload ‖ sig layout; Sign.verify parses, asserts suite_byte, constant-time-compares ctx, returns payload; Sign.peek exposes offsets without verifying; Sign.signDetached / Sign.verifyDetached raw-signature paths; failure modes route through SigningError discriminators (sig-blob-too-short, sig-suite-unknown, sig-ctx-overflow, sig-ctx-mismatch, verify-failed) |
20 tests | - |
sign/sign-envelope-vectors.test.ts |
Sign envelope wire-format gate: hand-assembled blob hex against Sign.sign output under the deterministic fixture suite. Three pinned vectors covering empty ctx + empty payload, mid-range ctx + payload, and a 200-byte ctx + 128 B payload near the wire ctx_len u8 ceiling. Asserts blob bytes, peek offsets, and verify round-trip |
3 vectors, 3 tests | GATE |
sign/sign-stream.test.ts |
SignStream lifecycle: prehash construction over StreamableSignatureSuite, update(chunk) feeds running SHA3-256 / SHA3-512, finalize() returns envelope bytes byte-identical to Sign.sign on the equivalent message, update() after finalize() throws SigningError('sig-stream-finalized'), post-dispose() throws SigningError('sig-stream-disposed'), exclusivity token released on dispose(), idempotent dispose()
|
12 tests | - |
sign/verify-stream.test.ts |
VerifyStream lifecycle: wire-format parse (suite_byte / ctx_len / ctx / payload / sig boundaries), constant-time ctx compare against constructor ctx, prehash running over chunks, buffered payload returned on finalize() success, auth failure wipes buffered chunks before SigningError propagates, wire-suite mismatch throws sig-suite-mismatch, malformed input routes through the documented discriminator set, dispose() idempotent |
16 tests | - |
sign/sign-stream-equivalence.test.ts |
Equivalence gate: SignStream chunked over (suite, sk, ctx) produces bytes byte-identical to Sign.sign(suite, sk, fullMsg, ctx) for the same suite (deterministic fixture and MlDsa{44,65,87}PreHashSuite), and VerifyStream accepts a Sign.sign output as wire bytes. Locks the "wire format does not depend on production method" contract |
24 tests | GATE |
sign/sign-mldsa-suites.test.ts |
Six ML-DSA suite consts (MlDsa44Suite, MlDsa65Suite, MlDsa87Suite, MlDsa44PreHashSuite, MlDsa65PreHashSuite, MlDsa87PreHashSuite): format-byte catalog allocations, ctxDomain strings, pkSize / skSize / sigMaxSize match FIPS 204 parameter sets, wasmModules declares ['mldsa', 'sha3'], per-call WASM lifecycle (instance constructed, used, disposed inside sign / verify / signPrehashed / verifyPrehashed), hedged signing produces distinct sigs over same (sk, msg, ctx), cross-suite domain separation (sig produced under one suite verifies false under sibling), keygen() returns { pk, sk } named-field object |
78 tests | - |
sign/sign-mldsa-vectors.test.ts |
Three deterministic wire-format KAT vectors covering MlDsa44PreHashSuite, MlDsa65PreHashSuite, MlDsa87PreHashSuite. Sign.verify returns the expected payload, Sign.peek returns the documented offsets. Hedged-produce-then-verify is covered by sign-mldsa-integration.test.ts; this file locks the wire bytes for verifiers |
3 vectors, 7 tests | - |
sign/sign-mldsa-integration.test.ts |
End-to-end envelope path against real ML-DSA primitives: Sign.sign → Sign.verify round-trip for a pure suite (MlDsa65Suite) and a prehash suite (MlDsa65PreHashSuite); SignStream → VerifyStream round-trip via the prehash suite, proving the SHA3-256 running-hash wiring lines up with the suite's signPrehashed / verifyPrehashed path; ctx round-trip; tamper rejection |
5 tests | - |
sign/sign-ed25519-suites.test.ts |
Two Ed25519 suite consts (Ed25519Suite 0x01 pure, Ed25519PreHashSuite 0x11 Ed25519ph): format-byte catalog allocations, ctxDomain strings (ed25519-envelope-v3, ed25519-prehash-envelope-v3), 32-byte pk/sk and 64-byte sig per RFC 8032, frozen wasmModules (pure: ['curve25519'], prehash: ['curve25519','sha2']), prehash locks prehashAlgorithm:'sha-512' and prehashSize:64. Pure-mode lock: sign / verify with non-empty user_ctx throw SigningError('sig-ctx-unsupported'); pure with empty ctx round-trips. Prehash round-trip across ctx ∈ {empty, 10, 226} (the 226-byte case sits at the suite's combined effective_ctx ceiling per FIPS 204 §3.6.1), domain separation across ctx values, signPrehashed digest-size contract (correct verifies; wrong size on sign throws sig-malformed-input, on verify returns false), determinism check (RFC 8032 deterministic both modes), 256-byte ctx throws sig-ctx-too-long
|
26 tests | - |
sign/sign-ed25519-vectors.test.ts |
Seven deterministic wire-format KAT vectors covering Ed25519Suite (V1-V3 from RFC 8032 §7.1 TEST 1/2/3 seeds; pure sigs match the RFC reference verbatim inside the v3 envelope) and Ed25519PreHashSuite (V4-V7 from RFC 8032 §7.3 TEST abc seed, with empty / 12B / 100B / 200B user_ctx). Sign.sign(suite, sk, msg, ctx) produces byte-identical output to the recorded blobHex, Sign.verify returns the expected payload, Sign.peek returns the documented offsets. Both Ed25519 modes are deterministic per RFC 8032, so sign-side byte equality IS the gate |
7 vectors, 22 tests | - |
sign/sign-ed25519-integration.test.ts |
End-to-end envelope path against the real Ed25519 primitive: Sign.sign → Sign.verify round-trip for both suites, sig-ctx-mismatch on wrong ctx, SignStream → VerifyStream round-trip via the prehash suite (SHA-512 running hash wired through sign/hasher.ts), RFC 8032 §7.1 cross-check (pure suite reproduces the RFC sig verbatim inside the envelope), ACVP sigGen spot-check across pure records with empty context and prehash records with suite-bound ctx, cross-mode tamper rejection on both axes (flipped wire byte caught either as sig-suite-mismatch against the originally-signing suite or as verify-failed against the cross-mode suite) |
21 tests | - |
sign/sign-stream-equivalence-ed25519.test.ts |
Real-suite Sign-vs-SignStream byte-equivalence gate for Ed25519PreHashSuite. Ed25519ph is deterministic per RFC 8032 §5.1.7, so buffered Sign.sign output MUST be byte-identical to chunked SignStream(...).update(...).finalize(). Covers msg ∈ {0, 1, 100, 10000} × ctx ∈ {0, 10, 200} plus a five-chunk irregular split. VerifyStream round-trip accepts the streamed blob and returns the payload; mid-stream payload byte flip yields SigningError('verify-failed')
|
15 tests | GATE |
sign/sign-ecdsa-p256-suites.test.ts |
EcdsaP256Suite (formatEnum 0x02, single mode, SHA-256 prehash baked in): catalog allocations, ctxDomain ecdsa-p256-envelope-v3, 33B compressed pk / 32B sk / 64B sig per SEC 1 §2.3.3 + FIPS 186-5 §6.4, frozen wasmModules: ['p256','sha2'], prehashAlgorithm: 'sha-256', prehashSize: 32, conforms to StreamableSignatureSuite. ctx-rejection lock on every entry point (sign, verify, signPrehashed, verifyPrehashed throw SigningError('sig-ctx-unsupported') on non-empty user_ctx; FIPS 186-5 §6.4 has no native ctx). Digest contract: signPrehashed / verifyPrehashed throw sig-malformed-input on 31B / 33B digests. Round-trip across empty / 64B / 1024B messages; wrong pk and tampered msg return false. Hedged-by-default lock: two signs of the same (sk, msg) produce DIFFERENT signatures per draft-irtf-cfrg-det-sigs-with-noise-05 (inverse of Ed25519's determinism). |
23 tests | - |
sign/sign-ecdsa-p256-vectors.test.ts |
Tier 1 ECDSA-P256 corpus replay through the suite layer: RFC 6979 §A.2.5 'sample' / 'test' records via EcdsaP256._signInternalPk with zero rnd reproduce (r, low-S(s)) byte-for-byte and round-trip through verifyPrehashed; ACVP keyGen records (tg3 + tg4) drive keygenDerand(d) and assert pk = compressed(qx, qy); ACVP sigVer records (tg8) drive verifyPrehashed and match testPassed with strict-S adjustment; Wycheproof p1363 records drive verifyPrehashed under strict-gate normalisation (low-S enforced, non-64-byte sigs rejected, valid records require low-S, invalid records must fail). |
277 tests | - |
sign/sign-ecdsa-p256-integration.test.ts |
End-to-end envelope path for EcdsaP256Suite. Sign.sign → Sign.verify round-trip, Sign.peek reports [0x02][0x00][payload][sig] offsets, blob layout invariant. Sign.signDetached / Sign.verifyDetached round-trip; tampered sig returns false. Suite-level KAT replay (7 records covering empty / single-byte / 64B / 1024B / RFC 6979 sample+test / 4096B): recorded blob verifies through Sign.verify, Sign.peek matches, fresh hedged suite-level sign on the same (sk, msg) still round-trips. ctx-rejection at the envelope layer (Sign.sign / Sign.signDetached with non-empty ctx propagate sig-ctx-unsupported from the suite). Cross-suite tamper (0x02 ↔ 0x01) rejects with sig-suite-mismatch; verify under wrong P-256 pk rejects with verify-failed. |
19 tests | - |
sign/sign-stream-equivalence-ecdsa-p256.test.ts |
SignStream vs Sign.sign framing-equivalence gate for EcdsaP256Suite. Unlike Ed25519, ECDSA-P256 cannot byte-match across one-shot and streamed because each sign re-rolls randomBytes(32) per call (hedged); the gate asserts header + payload bytes are identical and only the trailing 64-byte sig differs. Covers msg ∈ {0, 1, 100, 4096}, a 5-chunk irregular split of a 523B msg, and two split shapes of a 1234B msg. VerifyStream accepts the streamed blob, chunked-feed parsing, and mid-payload tamper rejection. State-machine guards: update() after finalize() and double-finalize both throw sig-stream-finalized. Exercises the sha256Buffered shim in sign/hasher.ts end-to-end. |
11 tests | - |
sign/sign-slhdsa-suites.test.ts |
Six SLH-DSA suite consts (SlhDsa128fSuite, SlhDsa192fSuite, SlhDsa256fSuite, SlhDsa128fPreHashSuite, SlhDsa192fPreHashSuite, SlhDsa256fPreHashSuite): format-byte catalog allocations (0x06/07/08, 0x16/17/18), ctxDomain strings, pkSize / skSize / sigMaxSize match FIPS 205 §11.1 Table 2 parameter sets, wasmModules declares ['slhdsa'] for pure and ['slhdsa', 'sha3'] for prehash, per-call WASM lifecycle (instance constructed, used, disposed inside sign / verify / signPrehashed / verifyPrehashed), hedged signing produces distinct sigs over same (sk, msg, ctx), 223-byte ctx accepted (combined effective_ctx ceiling per FIPS 204 §3.6.1), 256-byte ctx throws SigningError('sig-ctx-too-long'), prehash digest-size validation (correct size verifies, wrong size on sign throws sig-malformed-input, wrong size on verify returns false) |
84 tests | - |
sign/sign-slhdsa-vectors.test.ts |
Six deterministic wire-format KAT vectors covering the three pure SLH-DSA suites and the three prehash variants. Sign.verify returns the expected payload, Sign.peek returns the documented offsets. Hedged-produce-then-verify is covered by sign-slhdsa-integration.test.ts; this file locks the wire bytes for verifiers |
6 vectors, 13 tests | - |
sign/sign-slhdsa-integration.test.ts |
End-to-end envelope path against real SLH-DSA primitives: Sign.sign → Sign.verify round-trip for each pure suite and each prehash suite, SignStream → VerifyStream round-trip for the three prehash suites, and a SHAKE128 / SHAKE256 single-shot vs streamed digest cross-check feeding signHashPrehashedDeterministic to prove the running-hash wiring lines up with the suite's signPrehashed / verifyPrehashed path |
21 tests | - |
sign/sign-stream-equivalence-slhdsa.test.ts |
Real-suite Sign-vs-SignStream byte-equivalence gate for the three SLH-DSA prehash suites under deterministic sub-sign: buffered SHAKE128/256 digest and SHAKE128Stream/SHAKE256Stream digest feed signHashPrehashedDeterministic; sigs must be byte-identical; envelope blob round-trips through Sign.verify and VerifyStream. Covers msg ∈ {0, 1024} × ctx ∈ {0, 200} per suite |
12 tests | GATE |
sign/sign-hybrid-pq-suites.test.ts |
Three PQ-only hybrid suite consts (MlDsa44SlhDsa128fSuite, MlDsa65SlhDsa192fSuite, MlDsa87SlhDsa256fSuite): format-byte catalog allocations (0x30/31/32), ctxDomain strings (mldsa{XX}-slhdsa{YYY}f-envelope-v3), composite pk / sk / sig sizes derived as sum of half sizes (FIPS 204 §4 + FIPS 205 §11.1), wasmModules declares ['mldsa', 'sha3', 'slhdsa'], prehash algorithm + size per security tier (shake-128/32 for cat-1, shake-256/64 for cat-3/5), ctx-length contract (223 B at the combined effective_ctx ceiling accepted, 256 B trips the absolute USER_CTX_MAX cap, 224 B trips the combined effective_ctx cap, all three discriminators are sig-ctx-too-long), hedged signing produces distinct sigs over same (sk, msg, ctx), wrong-pk verify returns false, wrong-size digest on signPrehashed throws sig-malformed-input and on verifyPrehashed returns false, wrong-size sk on signPrehashed throws sig-key-size
|
60 tests | - |
sign/sign-hybrid-pq-vectors.test.ts |
Three composite KAT vectors locking the v3 envelope wire format for the three hybrid suites under deterministic sub-signs. Sign.verify returns the expected payload, Sign.peek reports the documented offsets, catalog sizes match recorded pk / sk / blob. Hedged-produce-then-verify is covered by the integration test; this file locks the wire bytes for verifiers |
3 vectors, 10 tests | - |
sign/sign-hybrid-pq-integration.test.ts |
End-to-end envelope + streaming path against real ML-DSA + SLH-DSA primitives: Sign.sign → Sign.verify round-trip per hybrid; SignStream → VerifyStream round-trip per hybrid (mandatory prehash); Sign.peek offsets; hand-driven composite via deterministic sub-signs on both halves verifies through the suite (proves the shared digest + effective_ctx wiring matches docs/signaturesuite.md) |
15 tests | - |
sign/sign-hybrid-pq-tamper.test.ts |
Security-gate tamper suite for the three hybrid suites: tamper ML-DSA half → false; tamper SLH-DSA half → false; swap halves → false; truncated total length → false; padded total length → false; wrong pk (full swap, ML-DSA half only, SLH-DSA half only) → false. Plus cross-suite forgery resistance (standalone MlDsa44Suite sig placed as ML-DSA half of 0x30 hybrid is rejected because ctxDomain differs) and a verify-timing spot check that confirms verifyPrehashed always runs both sub-verifies (no early return on the first half's boolean) |
27 tests | - |
sign/sign-hybrid-classical-suites.test.ts |
Four classical+PQ composite hybrid suite consts (MlDsa44Ed25519Suite, MlDsa65Ed25519Suite, MlDsa44EcdsaP256Suite, MlDsa65EcdsaP256Suite) per draft-ietf-lamps-pq-composite-sigs: format-byte allocations (0x20-0x23), ctxDomain strings (mldsa{44,65}-{ed25519,ecdsa-p256}-envelope-v3), pk / sk / sigMaxSize per composite-sigs Appendix A Table 4, wasmModules declares the four required modules per suite (['mldsa', 'sha3', 'curve25519', 'sha2'] for the Ed25519 hybrids, ['mldsa', 'sha3', 'p256', 'sha2'] for the ECDSA hybrids), frozen wasmModules arrays, prehash algorithm + size (SHA-512/64 for 0x20/21/23, SHA-256/32 for 0x22), round-trip across empty / cap-boundary ctx, prehash digest size contract (wrong-size on sign throws sig-malformed-input, on verify returns false), 255-byte composite-sigs §3.2 step 1 ctx cap (256 B throws sig-ctx-too-long), hedged sign produces distinct sigs (ML-DSA + ECDSA halves are hedged; Ed25519 half is deterministic by RFC 8032 §5.1.6) |
76 tests | - |
sign/sign-hybrid-classical-vectors.test.ts |
Eight composite KAT vectors (four suites × two ctx variants, empty and non-empty) locking the v3 envelope wire format for the four classical+PQ hybrid suites. Sign.verify returns the expected payload, Sign.peek reports the documented offsets, catalog sizes match the recorded pk / sk / blob. Hedged-produce-then-verify is covered by the integration test; this file locks the wire bytes for verifiers |
8 vectors, 25 tests | - |
sign/sign-hybrid-classical-integration.test.ts |
End-to-end envelope + streaming path against real ML-DSA + Ed25519 / ECDSA-P256 primitives across all four suites: Sign.sign → Sign.verify round-trip; SignStream → VerifyStream round-trip (mandatory prehash); hand-driven composite via deterministic sub-signs proves the M' construction matches docs/signaturesuite.md (Ed25519 sigs reproduce byte-for-byte under deterministic seeding; ECDSA's hedged path is bounded via verify-against-spec) |
28 tests | - |
sign/sign-hybrid-classical-tamper.test.ts |
Security-gate tamper suite for the four classical+PQ hybrid suites: tamper ML-DSA half → false; tamper classical half → false; swap halves → false; truncated total length → false; padded total length → false; wrong pk (full swap, ML-DSA half only, classical half only) → false. Plus cross-suite forgery resistance (standalone MlDsa44Suite / Ed25519Suite / EcdsaP256Suite sigs placed as halves of 0x20-0x23 are rejected because the composite-sigs M' Label differs) and a verify-timing spot check that confirms verifyPrehashed always runs both sub-verifies (no early return on the ML-DSA half's boolean), per the leviathan divergence from composite-sigs §3.3's early-fail permission |
37 tests | - |
sign/sign-stream-equivalence-hybrid-classical.test.ts |
Sign-vs-SignStream framing-equivalence gate for the four classical+PQ hybrid suites. For the Ed25519 hybrids both halves of M' are byte-deterministic given the seed (ML-DSA hedged but driven by the same rnd here), enabling byte-exact sig equality on the deterministic path; for the ECDSA hybrids the gate relaxes to header + payload equality plus VerifyStream round-trip because hedged ECDSA re-rolls per call. Exercises the streaming createRunningHash SHA-256 / SHA-512 prehash shims for both PH choices per composite-sigs §10.5 external pre-hashing |
36 tests | GATE |
aes/aes_transpose.test.ts |
Bit-transposition round-trip identity: 128 distinct bytes, all-zeros, all-0xFF, FIPS 197 §B plaintext + 7 dummy blocks, single-bit isolation, asymmetric (block<<4)|byte pattern | 6 tests | Gate 1 |
aes/aes_sbox.test.ts |
Canright bitsliced S-box vs FIPS 197 §5.1.1 Figure 7 (all 256 byte inputs); Boyar-Peralta scalar S-box (key-schedule path, SLP_AES_113), exhaustive 256-byte coverage + packed 4-byte word independence | 512 vectors + 8 packed, 3 tests | Gate 2 |
aes/aes_round.test.ts |
Single AES round vs FIPS 197 §B Round 1 intermediate (aesRoundIntermediates128[0]) |
1 test | Gate 3 |
aes/aes_kat.test.ts |
AES-128/192/256 ECB encrypt KAT: FIPS 197 §B + 12 NIST CAVP AESVS .rsp files (GFSbox 7+6+5, KeySbox 21+24+16, VarKey 128+192+256, VarTxt 128+128+128 per direction) |
1039 vectors, 25 tests | Gate 4 |
aes/aes_decrypt.test.ts |
AES-128/192/256 ECB decrypt KAT (Equivalent Inverse Cipher, FIPS 197 §5.3.5): FIPS 197 §B inverse, encrypt→decrypt round-trip on 32 random vectors, 12 NIST CAVP AESVS .rsp [DECRYPT] sections |
1039 vectors, 26 tests | Gate 5 |
aes/aes_mmt.test.ts |
AES-128/192/256 ECB Multi-block Message Test (AESAVS §6.3): 3 NIST CAVP aes_ECBMMT*.rsp files, 10 enc + 10 dec vectors per file, plaintext lengths 1-10 blocks |
60 vectors, 9 tests | Gate 6 |
aes/aes_mct.test.ts |
AES-128/192/256 ECB Monte Carlo Test (AESAVS §6.4.1): 3 NIST CAVP aes_ECBMCT*.rsp files, 100 enc + 100 dec chains per file, 1000 inner iterations per chain, key-size-dependent chain rule (AES-192 uses last 8 B of CT[998] ‖ CT[999]) |
600 chains × 1000 iter, 9 tests | Gate 7 |
aes/aes_cbc.test.ts |
AES-128/192/256 CBC raw-block KAT (SP 800-38A §6.2): 12 NIST CAVP aes_CBC{GFSbox,KeySbox,VarKey,VarTxt}*.rsp files, encrypt + decrypt directions; bypasses PKCS7 to exercise the WASM mode directly. Decrypt path uses cbcDecryptChunk_simd. Plus the AESCbc dangerUnauthenticated constructor gate (throws without flag, constructs with flag) |
2078 vectors, 38 tests | Gate 8 |
aes/aes_cbc_mmt.test.ts |
AES-128/192/256 CBC Multi-block Message Test (AESAVS §6.3): 3 NIST CAVP aes_CBCMMT*.rsp files, 10 enc + 10 dec vectors per file, plaintext lengths 1-10 blocks |
60 vectors, 9 tests | Gate 9 |
aes/aes_cbc_mct.test.ts |
AES-128/192/256 CBC Monte Carlo Test (AESAVS §6.4.2): 3 NIST CAVP aes_CBCMCT*.rsp files, 100 enc + 100 dec chains per file, 1000 inner iterations per chain. Inner loop uses the §6.4.2 chain rule: PT[j+1] = CT[j-1] (encrypt) / CT[j+1] = PT[j-1] (decrypt); next-chain seed is the penultimate output, not the final |
600 chains × 1000 iter, 9 tests | Gate 10 |
aes/aes_ctr.test.ts |
AES-128/192/256 CTR mode (SP 800-38A §6.5, Appendix B.1): 6 SP 800-38A §F.5 worked-example vectors (3 keysizes × encrypt/decrypt), round-trip check, scalar/SIMD consistency across batch boundaries (1, 7, 8, 9, 16, 17, 128, 129 blocks), partial-block tail. Counter direction: 128-bit big-endian. Plus the AESCtr dangerUnauthenticated constructor gate (throws without flag, constructs with flag) |
18 tests | Gate 11 |
aes/aes_ghash.test.ts |
Standalone GHASH validation across all 18 McGrew-Viega Appendix B test cases (AES-128/192/256, 96-bit IV fast path and 64-/480-bit IV slow path). Drives loadKey → H derivation → 4-bit-windowed GF(2^128) multiply table → ghashStart/AbsorbWithLen directly; final tag = E(K, J0) XOR S compared with the published Tag. Isolates the GHASH primitive from full GCM | 18 tests | Gate 12 |
aes/aes_gcm_seal.test.ts |
AESGCM seal direction (SP 800-38D §7.1): 18 McGrew-Viega Appendix B vectors plus the three NIST CAVP aes_gcmEncryptExtIV{128,192,256}.rsp files (~23k vectors, 128-bit-tag subset). Output ct||tag matched byte-for-byte against published expected values |
18 + ~3k vectors, 21 tests | Gate 13 |
aes/aes_gcm_open.test.ts |
AESGCM open direction (SP 800-38D §7.2): three NIST CAVP aes_gcmDecrypt{128,192,256}.rsp files (128-bit-tag subset). Both passing vectors (decrypt to published PT) and FAIL vectors (must throw RangeError('authentication failed') on every tamper of tag/CT/AAD/IV/key). Verify-before-decrypt path |
~6k vectors, 6 tests | Gate 14 |
aes/aes_polyval.test.ts |
Standalone POLYVAL primitive validation (RFC 8452 §3, §7, Appendix A): full hash trace on the worked Appendix A example, mulX_GHASH on both Appendix A inputs, §7 field-ops XOR sanity, byteReverse16 helper. Path-(a) reflection-wrapper bridge, exercises mulXGhash, byteReverse16, and the four POLYVAL absorber entry points directly |
6 tests | Gate 15 |
aes/aes_gcm_siv_seal.test.ts |
AESGCMSIV seal direction (RFC 8452 Appendix C): all 50 published vectors (24 AES-128 + 24 AES-256 + 2 counter-wrap), full output ct||tag matched byte-for-byte against RFC result. Also covers derive_keys correctness against recordAuthKey/recordEncKey, POLYVAL input construction sanity check, POLYVAL hash output (S_s) and encrypted tag at TAG_OFFSET against the RFC intermediate fields, and silent counter-wrap behaviour |
50 vectors, 156 tests | Gate 16 |
aes/aes_gcm_siv_open.test.ts |
AESGCMSIV open direction (RFC 8452): round-trip on all 50 vectors plus tamper coverage, synthesised single-byte flips on tag/CT/AAD/nonce/key (one per keysize) must throw AuthenticationError('siv'). Gate 17g: after auth-fail, CHUNK_PT_OFFSET reads as zeros, verifies sivWipeOnFail actually wipes the unauthenticated plaintext before any TS code can observe it |
50 vectors, 66 tests | Gate 17 |
aes/aes_generator.test.ts |
AESGenerator for the Fortuna generator slot (Practical Cryptography §9.4): keystream cross-check vs raw AES (loadKey + encryptBlock) for n ∈ {0, 1, 16, 17, 64, 1024, 2^20}, 16-byte little-endian counter increment carry, argument validation (key/counter length, n bounds), caller-buffer non-mutation |
13 tests | - |
fortuna.test.ts |
Fortuna CSPRNG: Fortuna.create(), get() (always Uint8Array), entropy threshold, stop() disposes instance, SerpentCtr exclusivity coexistence, stop() exception-safety when serpent module is held by SerpentCtr (disposed flag set, key material wiped, throw surfaced). All tests run with SerpentGenerator + SHA256Hash to preserve historical coverage. |
11 tests | - |
fortuna/wipe-lifecycle.test.ts |
Wipe-before-reassign discipline in pseudoRandomData, reseed, addRandomEvent, and pool reset (4 tests); stop() wipes genKey + genCnt + every pool-hash chain and calls wipeBuffers() on every WASM module the chosen generator and hash touched (3 tests) |
7 tests | - |
fortuna/spec-conformance.test.ts |
Fortuna pool-selection conformance with Practical Cryptography §9.5.5: pool P_i consumed iff 2^i divides reseedCnt. Walks reseeds 1..16, asserts the consumed-pool set matches the divisibility rule per reseed. Includes pool 0 consumed on every reseed regression for the F-1 fix |
2 tests | - |
fortuna/pluggable-primitives.test.ts |
Fortuna (Generator, HashFn) combinations: 6 KAT round-trip groups (Serpent+SHA2, Serpent+SHA3, ChaCha20+SHA2, ChaCha20+SHA3, AES+SHA2, AES+SHA3) against fortuna_kat.ts vectors, size-mismatch validation, missing-arg validation, F-2 zero-entropy regression |
22 tests | Gate (cross-primitive plumbing) |
fortuna/generator-output-shape.test.ts |
SerpentGenerator, ChaCha20Generator, and AESGenerator output shape: result.length === buffer.byteLength === n for n ∈ {0, 1, 15, 16, 17, 30, 31, 32, …}; no extra keystream bytes beyond requested length |
39 tests | - |
fortuna/generator-hash-wipe.test.ts |
Per-call WASM-scratch wipe in SerpentGenerator.generate, ChaCha20Generator.generate, AESGenerator.generate, SHA256Hash.digest, and SHA3_256Hash.digest. Asserts the relevant key/input/output offsets in shared linear memory are zeroed after each call, so secret-derived bytes do not outlive the operation in the shared module |
5 tests | - |
stream/header.test.ts |
readHeader strict length (exact, short, long), writeHeader formatEnum range, KEM × cipher cross-product round-trip (mlkem768+xchacha20, aes-gcm-siv 0x04, mlkem512/768/1024 + aes-gcm-siv = 0x14/0x24/0x34), makeCounterNonce safe-integer guards (0, MAX_SAFE_INTEGER, overflow, negative, fractional, NaN, Infinity) |
20 tests | - |
stream/sealstream.test.ts |
SealStream/OpenStream: round-trip, AAD, framed mode, authentication (tamper, reorder, replay), seek, TransformStream round-trip, empty-stream key wipe, state machine, dispose, chunk-size validation, key validation, _nonce validation, header chunkSize validation. XChaCha20, Serpent, and AES-GCM-SIV ciphers. Cross-cipher rejection, CipherSuite contract verification, Serpent-specific key separation/IV determinism/counter binding, OpenStream commitment verification (XChaCha20 v3 and AES-GCM-SIV v3 fail-fast on commitment tamper) |
143 tests | - |
stream/sealstream_xchacha_kat.test.ts |
SealStream XChaCha20 v3 KAT: pinned vectors XC1 (single-chunk), XC3 (multi-chunk), XCF1 (framed). Preamble (header + commitment) match, per-chunk ciphertext match, round-trip |
9 tests | - |
stream/sealstream_serpent_kat.test.ts |
SealStream Serpent v2 KAT: pinned vectors SC1 (single-chunk), SC3 (multi-chunk), SCF1 (framed). Preamble match, per-chunk ciphertext match, round-trip |
9 tests | - |
stream/sealstream_aes_kat.test.ts |
SealStream AES-GCM-SIV v3 KAT: pinned vectors AC1 (single-chunk), AC3 (multi-chunk), ACF1 (framed). Preamble (header + commitment) match, per-chunk ciphertext match, round-trip |
9 tests | - |
stream/seal.test.ts |
Cipher-agnostic stream contract tests parameterized over _cipher-spec.ts (XChaCha20, Serpent, AES-GCM-SIV): CipherSuite contract pinning (formatEnum, formatName, hkdfInfo, sizes, modules), Seal round-trips + AAD + AAD-mismatch with tagDiscriminator assert (xchacha20-poly1305/serpent/aes-gcm-siv), empty-plaintext, blob-format, Seal._fromNonce determinism, OpenStream-compat, error handling (truncated → RangeError, wrong-suite → format mismatch), failure modes with discriminator-asserted wrong-key (commitment fast-fail for v3, HMAC tag mismatch for Serpent), tampered tag, tampered ciphertext; size-sweep round-trips across plaintext sizes ∈ {0, 1, 16, 1024, 65535} per cipher |
63 tests | - |
stream/aes-cipher-suite.test.ts |
AES-GCM-SIV per-cipher contract tests: deriveKeys 32-byte bytes + 32-byte commitment with independent backing, header binding required (undefined or wrong-length throws), nonce-uniqueness derivation, header binding (framed-flag/chunkSize/nonce tamper → commitment-aes-gcm-siv fail-fast), commitment region tamper (commitment-aes-gcm-siv) |
8 tests | - |
stream/xchacha20-cipher-suite.test.ts |
XChaCha20 per-cipher contract tests: deriveKeys 32-byte bytes + 32-byte commitment with independent backing, header binding required (undefined or wrong-length throws), nonce-uniqueness derivation, header binding (framed-flag/chunkSize/nonce tamper → commitment-xchacha20 fail-fast), commitment region tamper (commitment-xchacha20) |
8 tests | - |
stream/serpent-cipher-suite.test.ts |
Serpent per-cipher contract tests with inverse assertions (no header binding, no commitment field): deriveKeys returns 96-byte enc+mac+iv keys with commitment === undefined, identical derived keys across two different headers (pin not-header-binding contract), header binding inverse, chunkSize tamper does NOT cause failure, nonce tamper DOES (HMAC-tag mismatch with serpent discriminator, NOT commitment), Serpent's preamble has no commitment region (commitmentSize === 0), wrong-key surfaces native HMAC key-committing property (serpent discriminator, NOT commitment-) |
8 tests | - |
stream/seal_xchacha_kat.test.ts |
Seal XChaCha20 v3 KAT: pinned vectors xc1 (100B), xc_empty (empty). Blob match, 52-byte preamble (header + commitment) match, format enum 0x03 check, Seal.decrypt round-trip, OpenStream.finalize round-trip |
10 tests | - |
stream/seal_serpent_kat.test.ts |
Seal Serpent v2 KAT: pinned vectors sc1 (100B), sc_empty (empty). Blob match, 20-byte preamble match, format enum 0x02 check, Seal.decrypt round-trip, OpenStream.finalize round-trip |
10 tests | - |
stream/seal_aes_kat.test.ts |
Seal AES-GCM-SIV v3 KAT: pinned vectors ac1 (100B), ac_empty (empty). Blob match, 52-byte preamble (header + commitment) match, format enum 0x04 check, Seal.decrypt round-trip, OpenStream.finalize round-trip |
10 tests | - |
stream/salamander-resistance.test.ts |
Invisible Salamanders mitigation regression: parameterized over XChaCha20 v3 and AES-GCM-SIV v3. Distinct master keys produce distinct 32-byte commitments under identical nonce + INFO + header; identical key but tampered header produces different commitments; OpenStream construction with the wrong key throws AuthenticationError carrying commitment-xchacha20 / commitment-aes-gcm-siv before any chunk decode; Seal.decrypt carries the same discriminator; commitment fail-fast precedes first-chunk decode (timing-anchor regression) |
10 tests | - |
stream/seek-forward-only.test.ts |
OpenStream.seek forward-only: backward seeks throw RangeError with 'forward-only', indices above MAX_SAFE_INTEGER throw without mutating counter, fully validates before mutating |
9 tests | - |
stream/failed-state.test.ts |
'failed' terminal state: SealStream and OpenStream crypto-path throws (auth failure, WASM errors, cipher exceptions) wipe derived keys and lock the stream; subsequent ops and seek() throw 'failed'; dispose() on 'failed' is a no-op; argument-validation errors are NON-terminal (state stays 'ready') |
14 tests | - |
stream/pool.test.ts |
SealStreamPool: round-trip (XChaCha20, Serpent, AES-GCM-SIV), auth failure, lifecycle (destroy, double-destroy, dead pool), key-material wipe, worker count, WASM loading variants, seal-twice guard, header validation (format mismatch, chunkSize mismatch, short ciphertext), KEM rejection, commitment verification on open() (XChaCha20 v3 and AES-GCM-SIV v3 fail-fast on commitment tamper) |
74 tests | - |
stream/pool-byte-exact.test.ts |
SealStream output === SealStreamPool output for XChaCha20, Serpent, and AES-GCM-SIV across size sweep including 5 MB payload, proves single-thread ↔ pool wire-format byte-equivalence |
21 tests | - |
stream/pool-terminal-on-throw.test.ts |
SealStreamPool.seal() is uniformly terminal on any throw. Crypto-path failure (worker-side wipe via type: 'wipe' injection) and output-assembly failure (fake worker result with length === MAX_SAFE_INTEGER forces new Uint8Array(totalLen) RangeError) both route through _killAll: pool.dead flips true, _masterKey and _keys nulled, subsequent seal() throws "pool is dead" |
2 tests | - |
stream/pool-wipe-handshake.test.ts |
SealStreamPool wipe ACK handshake: master-thread waits for every worker to ACK its key wipe before resolving destroy(), guarantees no key bytes outlive the pool in any worker |
2 tests | - |
All tests run in three browsers: Chromium, Firefox, and WebKit.
| File | Description | Tests |
|---|---|---|
serpent_kat.spec.ts |
KAT vt (384) + vk (576) + decrypt (384) + S-box (1536) | 4 |
serpent_iv.spec.ts |
Intermediate values, final CT for 3 key sizes | 1 |
serpent_nessie.spec.ts |
NESSIE 256-bit (1284) + 128-bit (1028) | 2 |
serpent_ctr.spec.ts |
CTR mode cases A-E (parameterized over CTR_VECTORS) |
5 |
serpent_montecarlo.spec.ts |
ECB MC + CBC MC enc + CBC MC dec (50 outer × 10000 inner) | 3 |
chacha20.spec.ts |
ChaCha20 RFC §2.4.2 encryption + 128B round-trip | 2 |
chacha20_simd.spec.ts |
SIMD ChaCha20: 114B/256B/320B SIMD === scalar | 3 |
poly1305.spec.ts |
Poly1305 RFC §2.5.2 gate + wipeBuffers verification |
2 |
chacha20poly1305.spec.ts |
ChaCha20-Poly1305 RFC §2.8.2 sunscreen AEAD + round-trip | 2 |
xchacha20.spec.ts |
XChaCha20-Poly1305 draft §A.3.2 AEAD + round-trip | 2 |
sha256.spec.ts |
SHA-256 empty (Gate 3), "abc", streaming 4×64B | 3 |
sha512.spec.ts |
SHA-512 "abc" (Gate 4), SHA-384 "abc", streaming 4×128B | 3 |
hmac.spec.ts |
HMAC-SHA256 TC1 (Gate 5), HMAC-SHA512 TC6 (Gate 6), HMAC-SHA256 TC2 | 3 |
sha3.spec.ts |
SHA3-256 empty (Gate 7), SHA3-512 "abc", SHAKE128 empty/32B | 3 |
chacha20_simd_bench.spec.ts |
ChaCha20 SIMD throughput benchmark (256B, 16KB, 64KB) | 3 |
serpent_simd_cbc.spec.ts |
SIMD CBC decrypt round-trip (8-block + 5-block) | 2 |
serpent_simd_ctr.spec.ts |
SIMD CTR mode cases A-E (parameterized over CTR_VECTORS) |
5 |
serpent_simd_bench.spec.ts |
Serpent SIMD throughput benchmark (1KB, 16KB, 64KB) | 3 |
seal.spec.ts |
Seal round-trip (XChaCha20 + Serpent) + Seal.encrypt → OpenStream.finalize unified wire format (both ciphers) |
4 |
sealstream_xchacha_kat.spec.ts |
SealStream XChaCha20 v3 KAT batch, XC1, XC3, XCF1 |
1 |
sealstream_serpent_kat.spec.ts |
SealStream Serpent v2 KAT batch, SC1, SC3, SCF1 |
1 |
pool.spec.ts |
SealStreamPool: XChaCha20 + Serpent round-trip (2 workers), pool seal → OpenStream open, large payload multi-worker, cross-instance seal/open (both ciphers), tampered ciphertext puts the pool in dead state |
7 |
pool_dispose.spec.ts |
Explicit destroy() during in-flight seal() and open(), both settle cleanly without leaving dangling worker promises |
2 |
serpent_large_pool.spec.ts |
SealStreamPool Serpent large-chunk: 256 KB (4 full chunks), 5 MB hash comparison, regression for pre-fix corruption (full chunks decrypt correctly, not just trailing partial) |
3 |
pool_csp.spec.ts |
SealStreamPool under CSP: blob worker round-trip with worker-src/child-src blob: (Chromium/Firefox pass, WebKit refuses the blob resource), blob refused without blob:, and the createPoolWorker same-origin worker override under worker-src 'self' (all engines) |
4 |
mlkem_suite.spec.ts |
MlKemSuite (MlKem768 + XChaCha20): Seal one-shot round-trip, SealStream/OpenStream streaming round-trip, preamble length (HEADER_SIZE + 1088B) |
3 |
loader.spec.ts |
WasmSource loader: all 7 source types (embedded, URL, ArrayBuffer, Uint8Array, WebAssembly.Module, Response, Promise<Response>) via init() + SHA3-256 FIPS 202 digest proof, plus regression that nested Promise.resolve(Promise.resolve(...)) wrapping doesn't false-positive trip the depth guard |
8 |
loader_csp.spec.ts |
All 7 WasmSource types under a strict Content-Security-Policy page (no unsafe-eval, no unsafe-inline), proves none of the loader code paths require an eval-unfriendly compile route |
7 |
loader_csp_negative.spec.ts |
All 7 WasmSource types under a CSP WITHOUT wasm-unsafe-eval, proving the directive is required: every compile path fails to initialize. Chromium/Firefox reject at compile, WebKit at instantiation |
7 |
fortuna.spec.ts |
Fortuna CSPRNG: four (generator, hash) pair smoke (Serpent/ChaCha20 × SHA-256/SHA3-256), DOM entropy collector wiring (mouse + keyboard via Playwright synthesis), stop() listener removal (post-stop methods throw), SerpentCtr exclusivity coexistence, external entropy seed |
5 |
ratchet.spec.ts |
SPQR ratchet (MlKem768 + SerpentCipher + Seal): same-realm two-party 10-message round-trip, out-of-order delivery via SkippedKeyStore (5 messages reordered with ResolveHandle.commit/rollback), tamper + rollback preserves the key for legitimate retry |
3 |
worker_context.spec.ts |
Library functions inside a Web Worker: SHA-256 "abc" digest, Seal round-trip (XChaCha20), Fortuna with external entropy. Validates dynamic import(), init(), primitive use, and disposal all work cross-realm |
3 |
merkle-log.spec.ts |
MerkleLog + MerkleVerifier end-to-end: Ed25519 + SHA-256 full lifecycle (append, head, inclusion proof at index 2, consistency proof between two snapshots, all three verify methods succeed), the equivalent MlDsa44Suite + SHA-256 lifecycle proving the c2sp.org cosigned-message PQ path, plus a tampered-envelope rejection that ensures verifyCheckpoint returns false on a flipped body byte |
3 |
sign_envelope.spec.ts |
Sign envelope API smoke across all 7 signature families: Ed25519Suite (RFC 8032 §7.1 TEST 1 deterministic byte gate, round-trip + tamper), Ed25519PreHashSuite (round-trip with non-empty ctx + wrong-ctx rejection), EcdsaP256Suite (round-trip, two-signs-differ hedging assertion, signDetached/verifyDetached raw round-trip), MlDsa44Suite (hedged round-trip + ctx mismatch), MlDsa44PreHashSuite (round-trip), SlhDsa128fSuite (hedged round-trip), MlDsa44SlhDsa128fSuite (PQ hybrid round-trip + tamper), MlDsa44Ed25519Suite (classical hybrid round-trip), MlDsa44EcdsaP256Suite (classical hybrid round-trip), cross-suite tamper (Ed25519 blob flipped to EcdsaP256 suite_byte), Sign.peek offset shape |
13 |
sign_stream.spec.ts |
SignStream / VerifyStream cross-browser smoke: Ed25519PreHashSuite chunked-stream byte-equivalence with Sign.sign (Ed25519ph determinism), EcdsaP256Suite header+payload equivalence with sig divergence (hedged), MlDsa44PreHashSuite VerifyStream accepts Sign.sign output (chunked feed), MlDsa44PreHashSuite mid-payload byte-flip rejection |
4 |
Note
E2E Monte Carlo tests use 50 outer iterations in Playwright (vs 1200 in Vitest) for cross-browser performance. A correct 50-iteration result is strong evidence of correct 1200-iteration behavior as errors compound within the first few iterations.
| File | Source | Vectors | Status |
|---|---|---|---|
serpent_ecb_vt.txt |
AES submission floppy4, variable text | 384 | VERIFIED |
serpent_ecb_vk.txt |
AES submission floppy4, variable key | 576 | VERIFIED |
serpent_ecb_tbl.txt |
AES submission floppy4, S-box table | 1536 | VERIFIED (gate: Serpent S-box) |
serpent_ecb_iv.txt |
AES submission floppy4, intermediate values | 3 key sizes | VERIFIED (gate: Serpent key schedule) |
serpent_ecb_e_m.txt |
AES submission floppy4, ECB Monte Carlo encrypt | 1200 | VERIFIED |
serpent_ecb_d_m.txt |
AES submission floppy4, ECB Monte Carlo decrypt | 1200 | VERIFIED |
serpent_cbc_e_m.txt |
AES submission floppy4, CBC Monte Carlo encrypt | 1200 | VERIFIED |
serpent_cbc_d_m.txt |
AES submission floppy4, CBC Monte Carlo decrypt | 1200 | VERIFIED |
serpent_nessie-128.txt |
NESSIE project | 1028 | VERIFIED |
serpent_nessie-192.txt |
NESSIE project | 1156 | VERIFIED |
serpent_nessie-256.txt |
NESSIE project | 1284 | VERIFIED |
serpent_ctr.ts |
Self-generated against the v3 SerpentCtr WASM API, gated on the externally-authoritative NESSIE block KAT corpus. 5 cases (A-E) covering 128/192/256-bit keys, zero-IV and counter-wrap nonces. Original ctr_harness.c (preserved on the floppy1 branch) seeded the cases under floppy byte order; the v3 file holds the bytes regenerated under NIST natural byte order. |
5 | SELF-GENERATED (gate: Serpent CTR mode) |
serpent.ts |
Serpent round-trip fixture (3 × 1024-byte chunks) | 1 | VERIFIED |
seal_xchacha_v3.ts |
Self-generated (--cipher xchacha), Seal XChaCha20 v3 KAT vectors XC1 (100B) and XC_EMPTY. 52-byte preamble (header + 32-byte commitment), HKDF info string binds the full header, independently verified against raw primitives (HKDF-SHA-256, HChaCha20, ChaCha20-Poly1305). |
2 | SELF-GENERATED |
seal_serpent_v3.ts |
Self-generated (--cipher serpent), Seal Serpent v3 KAT vectors SC1 (100B) and SC_EMPTY. 20-byte preamble, independently verified against raw primitives (HKDF-SHA-256, SerpentCbc, HMAC-SHA-256). |
2 | SELF-GENERATED |
sealstream_xchacha_v3.ts |
Self-generated (--cipher xchacha), SealStream XChaCha20 v3 KAT vectors XC1 (single-chunk), XC3 (multi-chunk), XCF1 (framed). 52-byte preamble (header + 32-byte commitment), each chunk independently verified against raw primitives (HKDF-SHA-256, HChaCha20, ChaCha20-Poly1305). |
3 | SELF-GENERATED |
sealstream_serpent_v3.ts |
Self-generated (--cipher serpent), SealStream Serpent v3 KAT vectors SC1 (single-chunk), SC3 (multi-chunk), SCF1 (framed). 20-byte preamble, each chunk independently verified against raw primitives (HKDF-SHA-256, SerpentCbc, HMAC-SHA-256). |
3 | SELF-GENERATED |
shake_xof.ts |
Self-generated, SHAKE128/256 multi-squeeze vectors (MS-1-MS-9). All chunks are slices of externally-verified KATs from sha3.ts, verified against Node.js crypto.createHash. |
8 | SELF-GENERATED |
chacha20.ts |
RFC 8439 §2.2.1, ChaCha20 block function | 1 | VERIFIED (gate: ChaCha20 block function) |
chacha20.ts |
RFC 8439 §2.4.2, ChaCha20 114-byte encryption | 1 | VERIFIED |
chacha20.ts |
RFC 8439 §2.5.2, Poly1305 34-byte message | 1 | VERIFIED (gate: Poly1305) |
chacha20.ts |
RFC 8439 §2.6.2, Poly1305 key generation | 1 | VERIFIED |
chacha20.ts |
RFC 8439 §A.3, Poly1305 TV #1-#6 | 6 | VERIFIED |
chacha20.ts |
RFC 8439 §2.8.2, ChaCha20-Poly1305 sunscreen AEAD | 1 | VERIFIED (gate: ChaCha20-Poly1305 AEAD) |
chacha20.ts |
draft-irtf-cfrg-xchacha-03 §A.3.1, HChaCha20 subkey | 1 | VERIFIED (gate: HChaCha20/XChaCha20) |
chacha20.ts |
draft-irtf-cfrg-xchacha-03 §A.3.2, XChaCha20-Poly1305 AEAD | 1 | VERIFIED |
sha2.ts |
FIPS 180-4 §B.1, SHA-256 "abc" | 1 | VERIFIED |
sha2.ts |
FIPS 180-4 §B.2, SHA-256 448-bit message | 1 | VERIFIED |
sha2.ts |
FIPS 180-4 §B.3, SHA-256 "a" × 1M | 1 | VERIFIED |
sha2.ts |
FIPS 180-4, SHA-256 boundary cases (empty, 55B, 56B, 64B) | 4 | VERIFIED (gate: SHA-256 empty) |
sha2.ts |
FIPS 180-4 §C.1-C.3, SHA-512 spec vectors | 4 | VERIFIED (gate: SHA-512 "abc") |
sha2.ts |
FIPS 180-4, SHA-512 boundary cases (empty, 111B, 112B, 128B) | 3 | VERIFIED |
sha2.ts |
FIPS 180-4 §D.1-D.2, SHA-384 spec vectors | 3 | VERIFIED |
sha2.ts |
RFC 4231 §4.2/§4.3/§4.7, HMAC-SHA256 TC1, TC2, TC6 | 3 | VERIFIED (gate: HMAC-SHA256 TC1) |
sha2.ts |
RFC 4231 §4.2/§4.3/§4.7, HMAC-SHA512 TC1, TC2, TC6 | 3 | VERIFIED (gate: HMAC-SHA512 TC6) |
sha2.ts |
RFC 4231 §4.2/§4.3/§4.7, HMAC-SHA384 TC1, TC2, TC6 | 3 | VERIFIED |
sha2.ts |
RFC 5869 §A.1/§A.2/§A.3, HKDF-SHA256 | 3 | VERIFIED (gate: HKDF-SHA-256 A.1) |
sha2.ts |
Node.js crypto.hkdfSync, HKDF-SHA512 (same inputs as RFC A.1-A.3) | 3 | VERIFIED |
sha3.ts |
FIPS 202 §A.1, SHA3-256 (empty, "abc", 448-bit) | 3 | VERIFIED (gate: SHA3-256 empty) |
sha3.ts |
FIPS 202, SHA3-256 rate boundary cases (135B, 136B, 137B) | 3 | VERIFIED |
sha3.ts |
FIPS 202 §A.4, SHA3-512 (empty, "abc") | 2 | VERIFIED |
sha3.ts |
FIPS 202, SHA3-512 rate boundary cases (71B, 72B, 73B) | 3 | VERIFIED |
sha3.ts |
FIPS 202, SHA3-384 (empty, "abc") + rate boundary (103B, 104B) | 4 | VERIFIED |
sha3.ts |
FIPS 202, SHA3-224 (empty, "abc") + rate boundary (143B, 144B) | 4 | VERIFIED |
sha3.ts |
FIPS 202, SHAKE128 (empty×32, "abc"×32, empty×64, rate boundary) | 5 | VERIFIED |
sha3.ts |
Node.js crypto / Python hashlib, SHAKE128 multi-block (empty×200, empty×336, empty×400, "abc"×200) | 4 | VERIFIED |
sha3.ts |
FIPS 202, SHAKE256 (empty×32, "abc"×64, rate boundary) | 4 | VERIFIED |
sha3.ts |
Node.js crypto / Python hashlib, SHAKE256 multi-block (empty×200, empty×272, empty×300, "abc"×200) | 4 | VERIFIED |
kmac.ts |
NIST SP 800-185 example values (cSHAKE, KMAC, KMACXOF samples: 16 records); NIST ACVP cSHAKE-128-1.0, cSHAKE-256-1.0, KMAC-128-1.0, KMAC-256-1.0 (vsId=0, 8 records survive the byte-alignment filter to match the byte-oriented API) | 24 (16+8) | VERIFIED |
mlkem_keygen.ts |
NIST ACVP, ML-KEM keygen (d+z → ek+dk) | 75 (25×3) | VERIFIED (gate: ML-KEM keygen, mlkem.test.ts Gates 1-2) |
mlkem_encapdecap.ts |
NIST ACVP, ML-KEM encap (75 AFT), decap (30 VAL including implicit rejection), key validity checks (60 VAL) | 165 | VERIFIED (gate: ML-KEM encap/decap, mlkem.test.ts Gates 3-9) |
mldsa_keygen.ts |
NIST ACVP, ML-DSA keygen (xi → pk+sk), 25 AFT per parameter set | 75 (25×3) | VERIFIED |
mldsa_siggen.ts |
NIST ACVP, ML-DSA sigGen (pure + preHash + internal externalMu, deterministic + hedged); HashML-DSA merged via per-record preHash discriminator |
360 (24×15) | VERIFIED |
mldsa_sigver.ts |
NIST ACVP, ML-DSA sigVer (mixed pass/fail per testPassed); HashML-DSA merged via per-record preHash discriminator |
180 (12×15) | VERIFIED |
ratchet_kat.ts |
Self-generated, HKDF-SHA-256 ratchet KAT vectors (ratchetInitVectors, kdfChainVectors, kemRatchetDecapVectors). HKDF outputs independently verified against Python hmac/hashlib; KEM inputs sourced from NIST ACVP tcId 77. |
9 entries | SELF-GENERATED (gate: ratchetInit, kemRatchetDecap) |
aes.ts |
FIPS 197 (Update 1) §B, AES-128 cipher example | 1 | VERIFIED (gate: AES-128 cipher example) |
aes.ts |
FIPS 197 (Update 1) §A.1-A.3, KeyExpansion examples (AES-128/192/256) | 3 | VERIFIED (gate: AES key schedule) |
aes.ts |
FIPS 197 (2001) §C.2, AES-192 cipher example | 1 | VERIFIED |
aes.ts |
FIPS 197 (2001) §C.3, AES-256 cipher example | 1 | VERIFIED |
aes.ts |
FIPS 197 (Update 1) §5.1.1 Figure 7, S-box table | 1 (Uint8Array) | VERIFIED (gate: AES S-box) |
aes.ts |
FIPS 197 (Update 1) §B, AES-128 round intermediates | 10 | VERIFIED (gate: single round) |
aes.ts |
FIPS 197 (2001) §C.2, AES-192 round intermediates | 12 | VERIFIED |
aes.ts |
FIPS 197 (2001) §C.3, AES-256 round intermediates | 14 | VERIFIED |
aes_cbc.ts |
SP 800-38A §F.2, CBC-AES{128,192,256} encrypt + decrypt | 6 | VERIFIED |
aes_ctr.ts |
SP 800-38A §F.5, CTR-AES{128,192,256} encrypt + decrypt | 6 | VERIFIED |
aes_gcm.ts |
McGrew-Viega Appendix B, Galois/Counter Mode of Operation (GCM), January 2004 submission to NIST (archived; original URL no longer resolves; see Wayback Machine snapshot 2004-11-05) | 18 | VERIFIED |
aes_gcm_siv.ts |
RFC 8452 Appendix C, AES-GCM-SIV AEAD vectors (24 × AES-128-GCM-SIV in C.1, 24 × AES-256-GCM-SIV in C.2, 2 × counter-wrap edge cases in C.3) | 50 (24+24+2) | VERIFIED (gate: AES-GCM-SIV) |
polyval.ts |
RFC 8452 §7 + Appendix A, POLYVAL primitive vectors (1 §7 algebraic fieldOps + 2 Appendix A mulX_GHASH/mulX_POLYVAL examples + 1 Appendix A POLYVAL hash trace) | 4 (1+2+1) | VERIFIED (gate: POLYVAL primitive) |
aes_CBCGFSbox128.rsp |
NIST CAVP AESAVS §6.4.1, CBC GFSbox KAT, AES-128 (7 encrypt + 7 decrypt) | 14 | VERIFIED |
aes_CBCGFSbox192.rsp |
NIST CAVP AESAVS §6.4.1, CBC GFSbox KAT, AES-192 (6 encrypt + 6 decrypt) | 12 | VERIFIED |
aes_CBCGFSbox256.rsp |
NIST CAVP AESAVS §6.4.1, CBC GFSbox KAT, AES-256 (5 encrypt + 5 decrypt) | 10 | VERIFIED |
aes_CBCKeySbox128.rsp |
NIST CAVP AESAVS §6.4.2, CBC KeySbox KAT, AES-128 (21 encrypt + 21 decrypt) | 42 | VERIFIED |
aes_CBCKeySbox192.rsp |
NIST CAVP AESAVS §6.4.2, CBC KeySbox KAT, AES-192 (24 encrypt + 24 decrypt) | 48 | VERIFIED |
aes_CBCKeySbox256.rsp |
NIST CAVP AESAVS §6.4.2, CBC KeySbox KAT, AES-256 (16 encrypt + 16 decrypt) | 32 | VERIFIED |
aes_CBCMCT128.rsp |
NIST CAVP AESAVS §6.4.4, CBC Monte Carlo Test, AES-128 (100 encrypt + 100 decrypt) | 200 | VERIFIED |
aes_CBCMCT192.rsp |
NIST CAVP AESAVS §6.4.4, CBC Monte Carlo Test, AES-192 (100 encrypt + 100 decrypt) | 200 | VERIFIED |
aes_CBCMCT256.rsp |
NIST CAVP AESAVS §6.4.4, CBC Monte Carlo Test, AES-256 (100 encrypt + 100 decrypt) | 200 | VERIFIED |
aes_CBCMMT128.rsp |
NIST CAVP AESAVS §6.4.3, CBC Multi-Block Message Test, AES-128 (10 encrypt + 10 decrypt) | 20 | VERIFIED |
aes_CBCMMT192.rsp |
NIST CAVP AESAVS §6.4.3, CBC Multi-Block Message Test, AES-192 (10 encrypt + 10 decrypt) | 20 | VERIFIED |
aes_CBCMMT256.rsp |
NIST CAVP AESAVS §6.4.3, CBC Multi-Block Message Test, AES-256 (10 encrypt + 10 decrypt) | 20 | VERIFIED |
aes_CBCVarKey128.rsp |
NIST CAVP AESAVS §6.4.2, CBC Variable Key KAT, AES-128 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_CBCVarKey192.rsp |
NIST CAVP AESAVS §6.4.2, CBC Variable Key KAT, AES-192 (192 encrypt + 192 decrypt) | 384 | VERIFIED |
aes_CBCVarKey256.rsp |
NIST CAVP AESAVS §6.4.2, CBC Variable Key KAT, AES-256 (256 encrypt + 256 decrypt) | 512 | VERIFIED |
aes_CBCVarTxt128.rsp |
NIST CAVP AESAVS §6.4.2, CBC Variable Text KAT, AES-128 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_CBCVarTxt192.rsp |
NIST CAVP AESAVS §6.4.2, CBC Variable Text KAT, AES-192 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_CBCVarTxt256.rsp |
NIST CAVP AESAVS §6.4.2, CBC Variable Text KAT, AES-256 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_ECBGFSbox128.rsp |
NIST CAVP AESAVS §6.4.1, ECB GFSbox KAT, AES-128 (7 encrypt + 7 decrypt) | 14 | VERIFIED |
aes_ECBGFSbox192.rsp |
NIST CAVP AESAVS §6.4.1, ECB GFSbox KAT, AES-192 (6 encrypt + 6 decrypt) | 12 | VERIFIED |
aes_ECBGFSbox256.rsp |
NIST CAVP AESAVS §6.4.1, ECB GFSbox KAT, AES-256 (5 encrypt + 5 decrypt) | 10 | VERIFIED |
aes_ECBKeySbox128.rsp |
NIST CAVP AESAVS §6.4.2, ECB KeySbox KAT, AES-128 (21 encrypt + 21 decrypt) | 42 | VERIFIED |
aes_ECBKeySbox192.rsp |
NIST CAVP AESAVS §6.4.2, ECB KeySbox KAT, AES-192 (24 encrypt + 24 decrypt) | 48 | VERIFIED |
aes_ECBKeySbox256.rsp |
NIST CAVP AESAVS §6.4.2, ECB KeySbox KAT, AES-256 (16 encrypt + 16 decrypt) | 32 | VERIFIED |
aes_ECBMCT128.rsp |
NIST CAVP AESAVS §6.4.4, ECB Monte Carlo Test, AES-128 (100 encrypt + 100 decrypt) | 200 | VERIFIED |
aes_ECBMCT192.rsp |
NIST CAVP AESAVS §6.4.4, ECB Monte Carlo Test, AES-192 (100 encrypt + 100 decrypt) | 200 | VERIFIED |
aes_ECBMCT256.rsp |
NIST CAVP AESAVS §6.4.4, ECB Monte Carlo Test, AES-256 (100 encrypt + 100 decrypt) | 200 | VERIFIED |
aes_ECBMMT128.rsp |
NIST CAVP AESAVS §6.4.3, ECB Multi-Block Message Test, AES-128 (10 encrypt + 10 decrypt) | 20 | VERIFIED |
aes_ECBMMT192.rsp |
NIST CAVP AESAVS §6.4.3, ECB Multi-Block Message Test, AES-192 (10 encrypt + 10 decrypt) | 20 | VERIFIED |
aes_ECBMMT256.rsp |
NIST CAVP AESAVS §6.4.3, ECB Multi-Block Message Test, AES-256 (10 encrypt + 10 decrypt) | 20 | VERIFIED |
aes_ECBVarKey128.rsp |
NIST CAVP AESAVS §6.4.2, ECB Variable Key KAT, AES-128 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_ECBVarKey192.rsp |
NIST CAVP AESAVS §6.4.2, ECB Variable Key KAT, AES-192 (192 encrypt + 192 decrypt) | 384 | VERIFIED |
aes_ECBVarKey256.rsp |
NIST CAVP AESAVS §6.4.2, ECB Variable Key KAT, AES-256 (256 encrypt + 256 decrypt) | 512 | VERIFIED |
aes_ECBVarTxt128.rsp |
NIST CAVP AESAVS §6.4.2, ECB Variable Text KAT, AES-128 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_ECBVarTxt192.rsp |
NIST CAVP AESAVS §6.4.2, ECB Variable Text KAT, AES-192 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_ECBVarTxt256.rsp |
NIST CAVP AESAVS §6.4.2, ECB Variable Text KAT, AES-256 (128 encrypt + 128 decrypt) | 256 | VERIFIED |
aes_gcmDecrypt128.rsp |
NIST CAVP GCMVS §6.4, GCM authenticated decryption (mixed pass/fail), AES-128 | 7875 | VERIFIED |
aes_gcmDecrypt192.rsp |
NIST CAVP GCMVS §6.4, GCM authenticated decryption (mixed pass/fail), AES-192 | 7875 | VERIFIED |
aes_gcmDecrypt256.rsp |
NIST CAVP GCMVS §6.4, GCM authenticated decryption (mixed pass/fail), AES-256 | 7875 | VERIFIED |
aes_gcmEncryptExtIV128.rsp |
NIST CAVP GCMVS §6.4, GCM authenticated encryption (external IV), AES-128 | 7875 | VERIFIED |
aes_gcmEncryptExtIV192.rsp |
NIST CAVP GCMVS §6.4, GCM authenticated encryption (external IV), AES-192 | 7875 | VERIFIED |
aes_gcmEncryptExtIV256.rsp |
NIST CAVP GCMVS §6.4, GCM authenticated encryption (external IV), AES-256 | 7875 | VERIFIED |
Important
All vector files are read-only. Integrity is verified via
SHA256SUMS,
which pins the expected hashes for the checked-in vector files, whether the
underlying vectors are externally sourced or self-generated. They are the
immutable truth and must never be modified to make tests pass.
Note
seal_xchacha_v3.ts, seal_serpent_v3.ts, sealstream_xchacha_v3.ts,
sealstream_serpent_v3.ts, shake_xof.ts, and ratchet_kat.ts are
self-generated; there is no external authority for these wire formats or
output slices. Each was produced with fixed inputs and independently verified
against the underlying primitives. These vectors are regression trip-wires for
format stability, not proof of correctness against an external reference.
Generation scripts are kept in the repo so derivations can be audited or
reproduced.
| Document | Description |
|---|---|
| index | Project Documentation index |
| development.md | Day-to-day developer workflow: build, test, lint commands and the iteration loop |
| architecture | Repository structure, build and CI, WASM modules, public API, test suite, and security posture |
| audits.md | Per-primitive audit index |
| vector_audit.md | Test-vector tier classification, Rust verifier coverage, SHA256SUMS pinning |
| lexicon.md | Glossary of cryptographic terms |
| init.md |
init() API, loading modes, subpath imports |
| aead.md |
Seal, SealStream, OpenStream, SealStreamPool (tested primitives) |
| signing.md |
Sign, SignStream, VerifyStream (tested user-facing API) |
| signaturesuite.md |
SignatureSuite interface plus the 22 shipped *Suite consts (tested primitives) |
| merkle.md |
MerkleLog, MerkleVerifier, SignedLog (tested primitives) |
| serpent.md | Serpent-256 TypeScript API (tested primitives) |
| chacha20.md | ChaCha20 / Poly1305 TypeScript API (tested primitives) |
| aes.md | AES-128/192/256 TypeScript API and AES-GCM-SIV (tested primitives) |
| sha2.md | SHA-2 / HMAC / HKDF TypeScript API (tested primitives) |
| sha3.md | SHA-3 / SHAKE / streaming classes TypeScript API (tested primitives) |
| kmac.md | cSHAKE / KMAC / KMACXOF TypeScript API (tested primitives) |
| blake3.md | BLAKE3 TypeScript API (tested primitive) |
| mlkem.md | ML-KEM (FIPS 203) TypeScript API (tested primitive) |
| mldsa.md | ML-DSA (FIPS 204) TypeScript API (tested primitive) |
| slhdsa.md | SLH-DSA (FIPS 205) TypeScript API (tested primitive) |
| ed25519.md | Ed25519 (RFC 8032) TypeScript API (tested primitive) |
| x25519.md | X25519 (RFC 7748) TypeScript API (tested primitive) |
| ecdsa-p256.md | ECDSA-P256 (FIPS 186-5 §6) TypeScript API (tested primitive) |
| ratchet.md | SPQR ratchet TypeScript API (tested primitive) |
| loader.md | WASM binary loading strategies (tested in unit + e2e) |
| fortuna.md | Fortuna CSPRNG (tested primitive) |
| utils.md | Encoding utilities and constantTimeEqual (tested primitives) |
| types.md | Public interfaces verified by the test suite |
Important
Playwright's bundled Firefox runs WASM roughly 20x slower than the Firefox people actually install. Its optimizing JIT tier never engages, so every kernel sits on the baseline compiler at a flat throughput (ChaCha20 measures ~24 MB/s scalar and ~57 MB/s SIMD, against ~500 and ~1300 on Chromium and WebKit). Stock Firefox 149 runs these kernels at full speed, matching the other engines.
This is a test-harness artifact, not a library bug and not a real-user problem. If a Firefox e2e timing budget needs extra headroom to stay green, the headroom exists because Playwright's Firefox is slow at WASM, not because the kernels are slow. Do not try to optimize a library that is already fast on every real engine. A true cross-engine performance gate has to run in stock browsers, not Playwright's Firefox.