arXiv:2610.30645quant-phOct 2026

Manuscript Offprint

arXiv:2610.30645

FVQKD: A Formal Verification of Quantum Key Distribution Security in Rocq

Ruixuan Deng, Zhengfeng Ji, Jiayu Zhang, Li Zhou

Ruixuan Deng ∗^{*} †^{\dagger}, Zhengfeng Ji ∗^{*} †^{\dagger}, Jiayu Zhang †^{\dagger}, and Li Zhou ‡^{\ddagger}

∗^{*}Tsinghua University

†^{\dagger}Zhongguancun Laboratory

‡^{\ddagger}Institute of Software, Chinese Academy of Sciences

Abstract—Quantum key distribution (QKD), whose security is derived from quantum mechanics rather than computational assumptions, is moving into standardization and commercial deployment. Yet its security guarantees rest on technically delicate proofs checked by hand. Formal verification closes this gap, establishing a two-factor assurance: unconditional security from physical principles, and machine-checked proofs against reasoning errors. We present FVQKD, a Rocq library for machine-checking QKD security proofs. Its first result is a complete, end-to-end machine-checked proof of composable, finite-key security for BB84. The mechanization reconstructs the complete proof infrastructure from first principles, including the smooth entropy framework, the entropic uncertainty relation, and the Quantum Leftover Hash Lemma. It uncovers necessary side conditions that the published argument leaves unstated, one of which reveals a missing proof branch, and it grounds the information-theoretic bound in a formal semantics of protocol execution, which the pen-and-paper analysis lacks. The proof is entirely admit-free, relying only on the Rocq kernel and standard foundational axioms. To our knowledge, this is the first end-to-end formal verification of a QKD security proof. Built on MATHCOMP, MATHCOMP-ANALYSIS, and COQQ, the development provides quantum-information infrastructure designed for reuse across broader QKD variants and quantum cryptography applications.

I. INTRODUCTION

Quantum key distribution (QKD) offers a distinctive approach to secure key establishment for the quantum era. Unlike conventional public-key exchange protocols such as Diffie-Hellman, QKD derives the secrecy of a shared key from physical measurements governed by quantum mechanics rather than from computational hardness. Under suitable device model and authentication assumptions, it provides information-theoretic security against adversaries with unbounded computational resources, including a full-scale quantum computer. BB84 [1], proposed in 1984 by Bennett and Brassard, is the founding QKD protocol. Its inventors received the 2025 ACM A.M. Turing Award for their role in establishing the foundations of quantum information science [2]. QKD is also technologically distinctive: it uses quantum mechanics but requires only the ability to prepare, transmit, and measure single-qubit states, making it one of the earliest commercially mature quantum-information technologies. In the past four decades since its invention, QKD has advanced from a theoretical proposal to satellite-to-ground demonstrations [3] and active standardization [4], [5].

Although BB84 has a compelling security intuition, a rigorous proof that an eavesdropper cannot learn the key without causing detectable disturbance took more than a decade to establish. Lo and Chau [6] and Mayers [7] established the unconditional security of QKD in the asymptotic limit of infinitely many transmitted qubits. Shor and Preskill [8] simplified the argument by reducing it to the theory of quantum error correction. Subsequent work strengthened QKD security proofs in two complementary directions. Finite-key analysis makes the guarantee quantitative for a single protocol run at realistic block sizes that can be as few as 10410^{4} quantum signals. Composable security specifies that the generated key remains safe when used as a component of a larger protocol. For the proof line formalized in this paper, these newer advances rely on the smooth-entropy framework of Renner [9] and the tight finite-key analysis of Tomamichel et al. [10].

These security proofs combine deep results from quantum information theory and cryptography, including an entropic uncertainty relation that bounds an eavesdropper's knowledge, a sampling inequality that bounds the unobserved error rate, and a hashing lemma that converts residual uncertainty into secret key. The mathematical sophistication of these ingredients makes the resulting proofs difficult to understand and verify. This concern is not merely theoretical. Important results in quantum information theory have been found to contain serious gaps years after publication [11], [12]. The QKD community has also recognized such challenges. A recent survey identifies gaps and limitations in published decoy-state BB84 security proofs [13], while a new pen-and-paper proof explicitly aims for completeness and certification-grade rigor [14]. These developments raise a fundamental question: can QKD security proofs be placed on a more trustworthy foundation, one that systematically consolidates and verifies the results drawn from quantum information theory, cryptography, and physics?

Formal verification provides a systematic way to answer this question as it has already proved effective in classical security. Notable examples include verified cryptographic libraries such as HACL* [15] and EverCrypt [16], verified OS kernels such as seL4 [17], and certified compilers such as CompCert [18]. For cryptographic proofs, frameworks such as SSProve [19], CryptHOL [20], EasyCrypt [21], and CryptoVerif [22] support machine-checked reasoning about computational-security reductions [23]. Protocol-level frameworks such as Squirrel [24] and DY* [25], [26] support machine-checked security analyses of practical protocols. These cryptographic proof and protocol frameworks work well for classical cryptography, but QKD falls outside their scope. Its security is information-theoretic, resting on smooth-entropy bounds against an unbounded quantum adversary. It also requires mathematical foundations such as density operators, quantum channels, and smooth min- and max-entropy that these classical tools do not provide.

Proof assistants have also been applied to quantum computing and quantum information. Several foundational libraries and program verification frameworks have been established: in Rocq, CoQQ [27] provides a finite-dimensional quantum mechanics library and program logics [28], QWIRE [29], [30] and VOQC [31] target quantum circuit verification, with a certified end-to-end implementation of Shor's factoring algorithm [32] as one result, and VyZX [33] mechanizes reasoning about the ZX-calculus [34], [35], while ViCAR [36] supports automated rewriting and visualization for monoidal categories. Isabelle/HOL hosts a quantum computing library [37], [38] and a mechanized quantum Hoare logic [39]; Qbricks [40] embeds a circuit-building quantum language in Why3 to support high automation based on path-sum representations [41]. Recent Lean work develops kernel-checked infrastructure for finite-dimensional quantum information theory and applies it to quantum coding theorems [42]. For (post-)quantum cryptographic protocols, qRHL [43] has machine-checked the post-quantum security of the Fujisaki–Okamoto transform [44]. EasyPQC [45] and a computational post-quantum protocol logic [46] verify classical cryptographic schemes and protocols against quantum adversaries.

Closer to the focus of this paper are several works applying formal methods directly to QKD. Kubota et al. [47], [48] give a semi-automated verification of the Shor–Preskill-style BB84 proof route, different from the composable finite-key analysis formalized here. Boender et al. [49] develop Coq infrastructure for modeling quantum protocols, while Kammüller [50] formalizes a Bayesian/probabilistic BB84 argument in Isabelle. The Lean formal-qkd project [51] mechanizes secret-key-length computation equations and partial post-processing code, without the underlying composable security proof. Model-checking tools such as PRISM, QCTL, and QMC [52]–[54] and symbolic analyses [55]–[57] analyze protocol-level behavior, intruder models, or ETSI protocol-layer properties rather than mechanizing the finite-key security proof itself. Adjacent formalization efforts include the generalized quantum Stein's lemma in Lean [58] and classical Shannon information theory in Rocq [59].

As Table I summarizes, the closest existing formal developments each satisfy only a subset of these five properties; none achieves all of them. The central challenge of placing QKD security proofs on a trusted foundation therefore remains open. In this work, we fill this gap by presenting FVQKD, to our knowledge the first complete end-to-end machine-checked proof of composable finite-key security for a QKD protocol. By complementing security from quantum mechanics with machine-checked verification in Rocq,

TABLE I A COMPARISON OF FVQKD WITH PRIOR WORK.

DevelopmentFrameworkUQAComp.FKModelE2E
Kubota et al. [47], [48]qCCS*✓——✓—
Boender et al./Kammüller [49], [50]Coq/Isabelle———✓†—
Lean project [51]Lean———‡——
CryptHOL constr. crypto [20], [60]Isabelle/HOL—✓—✓§—
CHSH rigidity/Tsirelson [61], [62]Lean/Isabelle—————
FVQKD (this work)Rocq✓✓✓✓✓

UQA: unbounded quantum adversary; Comp.: composable security; FK: finite-key bound; Model: explicit protocol model; E2E: end-to-end QKD security proof. A checkmark marks each criterion met; — marks an unmet criterion. *Custom semi-automated quantum-process-calculus verifier, not a proof-assistant kernel. †Individual components only. §Finite-key key-length equations without security derivation. §Composable framework for classical, not quantum, protocols.

FVQKD provides an additional assurance layer for QKD systems. Built with Rocq [63], it uses MATHCOMP for algebra, MATHCOMP-ANALYSIS for real analysis, and CoQQ [27] for finite-dimensional quantum theory. As a major case study, FVQKD formalizes the tight composable finite-key security analysis of BB84 by Tomamichel et al. [10]. To this end, the mechanization reconciles the conventions of the six theoretical works underlying the BB84 security proof and supplies the side conditions that the published argument leaves implicit (Section VII). Figure 3 presents the overall structure of the development.

Contributions. Our contributions are twofold. First, FVQKD provides a reusable, modular formal-verification framework for QKD security proofs. It brings together machine-checked Rocq formalizations of Uhlmann's fidelity theorem, generalized (sub-normalized) fidelity, purified distance as a metric with monotonicity under completely positive trace-nonincreasing (CPTN) maps, the smooth-entropy calculus (smooth conditional min- and max-entropy, their duality and classical chain rules), the POVM-general smooth entropic uncertainty relation, the Quantum Leftover Hash Lemma, Serfling's sampling bound [64], and semidefinite-programming (SDP) strong duality. The SDP result establishes the primal direction of Tomamichel's Theorem 2.6 [65], proved from first principles. The majority of the project is protocol-agnostic, with no dependence on BB84 or any particular QKD protocol, and serves as a general framework that future QKD variants can instantiate without re-deriving the underlying mathematical machinery.

Second, FVQKD establishes an end-to-end machine-checked QKD security proof, instantiated for BB84: an unbroken, kernel-checked chain from a formal protocol program to a composable finite-key ε\varepsilon -security statement at the tight bound of Tomamichel et al. [10]. The proof contains no incomplete lemmas; developed from first principles, it relies solely on the Rocq kernel and three standard axioms inherited from MATHCOMP-ANALYSIS.

It is worth emphasizing that existing formal verification efforts in protocol security usually focus on protocol-level modeling: message flows, adversary capabilities, and reachability properties. For QKD, the mathematical security bound, not the protocol model, carries the main proof burden. Finite-key QKD proofs in the smooth-entropy tradition (BB84 [10], decoy-state variants [66], and measurement-device-independent protocols [67]) use the same chain of entropic uncertainty relation, Quantum Leftover Hash Lemma, and sampling bounds. Formalizing this chain once provides a reusable foundation for their mechanization in the future.

Outline. The paper is organized as follows. Section II introduces the quantum-mechanical foundations, the common structure of QKD protocols, and BB84. Section III fixes the composable security model and derives the finite-key bound from the chain of entropy inequalities. Section IV describes the protocol model and connects the mathematical proof to a concrete protocol specification. Section V details the proof architecture: the module decomposition and its design for reuse. Section VI discusses proof engineering: the backend libraries, the trusted computing base, and the representation layers. Section VII presents the verification findings: a missing proof branch and competing conventions across the literature. Section VIII discusses scope and future work. Section IX concludes.

References (100)

Couldn't load all references. Reload the page to try again.