WO-13 — QTL v2 port¶
Branch: wo-13-qtl-v2 (based on wo-10-genesis, commit de6467b)
Status: DONE for the Python reference and C++ primitives scope; full C++ envelope/wallet integration is queued as WO-13b. This is not a security certification.
Safety: QTL is for disposable test data only. It must never control physical access.
Implemented¶
The Python reference in research/python/qtl_v2_guarded.py now uses SHAKE256 for the envelope fingerprint, checkpoint commitments and Lock-B hash chain, and KMAC256 for the password check, Lock-B seed wrapping key and final encryption key. HKDF-SHA256 and SHA-256 are no longer used by the active QTL v2 prototype. The password KDF remains Argon2id, as specified. The v2 envelope retains an externally held fingerprint, strict profile allow-list, RAM preflight, password check before puzzle work, checkpointed resumable progress, and authenticated AES-256-GCM encryption.
The delay is split into Lock A, sequential modular squaring, and Lock B, a sequential SHAKE256 chain. Lock-B seeds and checkpoints are precomputed in an encrypted, single-use chain bank while idle; the envelope carries only the password-wrapped seed and checkpoint commitments, not the endpoint. The prototype’s toy profile uses 75,000 Lock-A squarings and 1,450,000 Lock-B steps. The recorded M1 profile uses 11,750,000 and 227,300,000 respectively.
Under e46/, the C++ library now provides the matching byte-level SHAKE/KMAC fingerprint, checkpoint, password-check, final-key, Lock-A and Lock-B operations; OpenSSL AES-256-GCM; and OpenSSL 3.6.5 Argon2id using the same password framing and parameters as Python. OpenSSL remains pinned by the existing CMake version check; no dependency was added. Golden vectors are in e46/golden/wo13-golden.json.
Verification¶
Python anti-lockout run: all 13 original cases passed, plus the separate Lock-B-only timing condition. Correct unlock: 2.102 s; wrong password rejected before puzzle work: 0.044 s; damaged puzzle rejected at its first checkpoint: 0.236 s. Interrupted unlock resumed successfully. Evidence was written outside the repository to
/tmp/wo13-evidence/anti-lockout-20261008-200515.json.Lock-B-only timing in the same run: Lock A 0.992 s, Lock B 1.062 s; the required bound is Lock B ≥ half of Lock A.
C++/Python differential: all frozen QTL vectors pass, including SHAKE-derived fields, KMAC fields, AES-GCM, and three Argon2id KATs. Fresh randomized checks cover fingerprint, Lock A, Lock B, checkpoints, KMAC outputs and AES-GCM. Zero mismatches.
Release and ASan/UBSan WO-13 CTest runs both pass. Release took 1.69 s; sanitizer took 12.39 s. Golden reproducibility checks pass.
Release toy-delay timing on this machine was 0.40 s for 75,000 Lock-A squarings and 0.62 s for 1,450,000 Lock-B steps. This supports the required lower bound for the tested build and machine; it does not establish a portable wall-clock duration.
rg -n -i 'sha.?256|hkdf|sha2' research/python/qtl_v2_guarded.py research/python/qtl_v2_tamper_test.pyreturns no matches.
Review limits¶
The complete C++ envelope serializer/parser, chain-bank lifecycle, RSA sealing, resumable unlock and C++ anti-lockout cases are explicitly queued as WO-13b for the wallet/GUI phase. This report does not represent the current C++ primitives as a complete wallet port.
Timing counts are machine- and implementation-dependent. The tests establish the Lock-B ≥ half-of-Lock-A condition on the recorded toy profile and host, not a fixed real-world wait. The 312-second profile has not been timed in this WO.
This work does not prove that SHAKE256 chains have no quantum shortcut. Decision #8 already flags the need for a construction-specific argument and resource model; the sequential-work claim remains an assumption, not a demonstrated result.
The golden generator can regenerate all vectors when
argon2-cffiandcryptographyare present. On a minimal Python host, CTest still checks the frozen Argon2/AES vectors against C++, while the generator reproducibility check independently regenerates the SHAKE/KMAC vectors.QTL remains an experimental lock for test data only; it must never control physical access.