Files
papers/lux-fhe-runtime/sections/04-cross-runtime-katology.tex
zeekay 98343d238e papers: Mar-3 freeze deliverables for hybrid PQ consensus stack
Quasar Horizon (consensus composition over Pulsar / ML-DSA / BLS lanes
under Prism + LSS lifecycle), Warp 2.0 (Pulse-backed cross-chain envelope
with forward-only v1->v2 migration and lattigo ReadUint64Slice DoS fix),
benchmark report (microbench, reshare, activation, Warp 2.0 verify, Prism
composition, GPU headroom, cross-WAN latency), and NIST IR 8214C-style
submission package (spec, parameter sets, domain separation, serialization,
reference-impl pointers, evaluation report, security analysis, side-channel
considerations).

All four deliverables compile cleanly via pdflatex+bibtex and reference
the canonical proof bucket files at proofs/{definitions,pulsar,lss,quasar}.
No duplication of proof bodies; cite by file path.
2026-03-03 12:00:00 -08:00

70 lines
2.5 KiB
TeX

\section{Cross-runtime katology}
\label{sec:cross-runtime-katology}
The Lux FHE-KAT corpus is the empirical witness for the dual-runtime
equivalence theorem. It is not a "test suite" in the QA sense ---
it is the artifact that pins format and gate semantics across runtimes.
\subsection{Generation pipeline}
\textbf{Go side} (regenerates):
\begin{lstlisting}
$ cd ~/work/lux/fhe
$ LUXCPP_DIR=$HOME/work/luxcpp scripts/regen-kats.sh
\end{lstlisting}
The script runs the Go KAT generators, writes JSON entries to
\texttt{\$LUXCPP\_DIR/crypto/fhe/test/kat/}, and emits a SHA-256
manifest at \texttt{lux/fhe/scripts/regen-kats.manifest.sha256}. The
\texttt{--verify} mode re-runs the generators and confirms byte-equality
against the existing manifest --- regeneration is non-deterministic if
this check fails.
\textbf{C++ side} (replays):
\begin{lstlisting}
$ cd ~/work/luxcpp/crypto/fhe
$ cmake -S . -B build && cmake --build build
$ ctest --test-dir build -R fhe_kat_replay
\end{lstlisting}
The \texttt{fhe\_kat\_replay\_test} target consumes every JSON entry,
re-derives the secret key from the entry's seed, encrypts each
plaintext bit, decrypts back, and asserts byte-equality of the
serialized ciphertexts and bit-equality of the decoded plaintexts.
\subsection{Reverse direction: C++ generates, Go verifies}
Theorem~\ref{thm:fhe-dual-runtime-equivalence} requires byte-equality
in \emph{both} directions. The reverse path is:
\begin{lstlisting}
# C++ generates a KAT entry under a fixed seed.
$ cd ~/work/luxcpp/crypto/fhe/build
$ ./fhe_kat_emit --param-set PN10QP27 --seed 0x... \
--out cppgen.json
# Go verifies it.
$ cd ~/work/lux/fhe
$ go test -run TestLuxFHECppKATReplay \
./test -- -kat ../../luxcpp/crypto/fhe/cppgen.json
\end{lstlisting}
The \texttt{TestLuxFHECppKATReplay} target reads the JSON, deserializes
through Go's wire-format decoder, and asserts that the encoded fields
match what Go would produce given the same seed. As of the
v0.1.0-rc1-fhe-scaffold milestone the harness covers parameter-set ID,
secret-key bytes, public-key bytes, and ciphertext bytes for the
deterministic encryption path; the encrypted-evaluation reverse path
lands at v0.1.0-rc2-fhe-gpu.
\subsection{Manifest discipline}
Each KAT regeneration produces a sorted SHA-256 manifest. The manifest
is committed alongside the regen script. Any host that regenerates the
KATs must match the manifest exactly; a mismatch is a determinism
break and blocks the merge. This is the same discipline the Pulsar /
Lens / Warp KAT regen scripts apply (see
\texttt{lux/pulsar/scripts/regen-kats.sh}).