Fresh Masking Makes NTT Pipelines Composable: Machine-Checked Proofs for Arithmetic Masking in PQC Hardware
Ray Iskander, Khaled Kirah
cs.CR
Apr 22, 2026 · v1
TL;DR
Three machine-checked Lean 4 + Mathlib results on fresh masking in NTT pipelines (zero sorry).
Abstract
Post-quantum cryptographic (PQC) accelerators for ML-KEM (FIPS 203) and ML-DSA (FIPS 204) rely on pipelined Number Theoretic Transform (NTT) stages over $\mathbb{Z}_q$. Our prior work established structural dependency analysis at scale [1] and quantified the security margin of partial NTT masking [2]. Whether per-stage arithmetic masking guarantees pipeline-level security had no prior machine-checked answer for the r-bearing case: composition frameworks (ISW, t-SNI, PINI, DOM) were formalized exclusively for Boolean masking over $\mathrm{GF}(2)$; no proof assistant artifact addresses the NTT butterfly over $\mathbb{Z}_q$. We present three machine-checked results in Lean 4 with Mathlib, all zero sorry. First, we close a stated limitation of prior work: value-independence implies constant marginal distribution under fresh randomness (via an algebraic MutualInfoZero proxy). Second, butterfly per-context uniformity: for any Cooley-Tukey butterfly with fresh output mask over $\mathbb{Z}/q\mathbb{Z}$ ($q > 0$), each output wire has exactly one mask value producing each output, a uniform marginal independent of secrets, universal over all moduli, twiddle factors, and inputs. Third, a k-stage NTT pipeline with fresh per-stage masking satisfies per-context uniformity at every stage under the ISW first-order probing model. We document a named warning: pointwise value-independence is false for butterfly outputs. The Adams Bridge accelerator (CHIPS Alliance Caliptra) fails the fresh masking hypothesis, masking active only in INTT round 0, architecturally explaining its structural insecurity. Artifact: nine theorems, 1,738 build jobs, zero sorry. Composition for nonlinear gadgets (Barrett) is addressed in forthcoming manuscripts proving Barrett's PF-PINI(2) satisfaction (one-bit barrier) [3] and k-stage composition for PF-PINI gadgets under fresh-mask renewal [4].
Problem
Post-quantum cryptographic accelerators for ML-KEM and ML-DSA rely on pipelined NTT stages. Whether per-stage arithmetic masking guarantees pipeline-level security had no machine-checked answer for the randomness-bearing case, as existing composition frameworks (ISW, t-SNI, PINI, DOM) were formalized only for gate-level or combinational circuits.
Approach
The authors develop a Lean 4 formalization that proves per-stage fresh masking in NTT pipelines composes to pipeline-level security. The formalization covers arithmetic masking over Z_q with structural dependency analysis, extending prior work on partial NTT masking to provide a machine-checked composability proof for the full pipeline.
Results
The formalization provides the first machine-checked proof that fresh masking makes NTT pipelines composable for PQC hardware, closing the gap between per-stage proofs and pipeline-level security guarantees.