Skip to content

Tracking: generic results from DeepMind's Signal verification #1086

Open

Description

@quangvdao

DeepMind has released a Lean verification of Signal's security down to machine code (blog post, paper, code at 808b4b7). Its computational part is built on VCVio, pinned at 967fdf2e, and uses OracleComp, simulateQ, 𝒟[·], IsQueryBoundP and SampleableType throughout.

This issue tracks moving the generic parts of that work into VCVio, and into PolyFun where a law is about handlers or cost in general. The Signal, PQXDH and libsignal games and proofs stay in DeepMind's repository.

Source paths below are relative to DeepMind's repository at 808b4b7.

Scope

Licensing and attribution

DeepMind's files carry Apache-2.0 headers ("Copyright 2026 Google LLC"), and the repository has no NOTICE file. A VCVio file that contains ported DeepMind text follows CONTRIBUTING.md ("Attribution And File Headers", point 4): it keeps Copyright (c) 2026 Google LLC, lists the porting authors in Authors:, and names the source file at 808b4b7 and the changes in its module docstring. Where we re-prove a statement against current VCVio API instead of copying the proof, the docstring credits DeepMind's file as the source of the statement.

Nothing comes from third_party/libsignal/ or the LibsignalTestVectors library, which are AGPL-3.0. No Google-authored code goes to PolyFun, QuantumFoundations or QuantumCrypto.

Generic lemmas

These need no design decision. Each VCVio port targets current main, which already includes #1023 (reducible simulateQ). Sources are under Computational/Proofs/. Three items are partly or wholly about distributions alone and go to PolyFun, on top of Verified-zkEVM/PolyFun#446 (merged): the uniform split equivalences (which may already follow from IsUniform.pair and IsUniform.map_of_bijective), the modular-reduction bias stated for uniformOn, and possibly the potential-function bound, as a corollary of wpFold_liftM_le. VCVio then gets the $ᵗ and simulateQ corollaries.

  • Move evalDistEq_map_run_simulateQ_eq_of_query_evalDistEq_map_eq from CryptoFoundations/GPVHashAndSign/TrapProjection.lean to OracleComp/SimSemantics/StateT/StateProjection.lean. This is housekeeping and copies no DeepMind code. Merged refactor(OracleComp): move a state-projection distribution lemma next to its sibling #1199.
  • Support and query bounds: AllSupport and its closure lemmas, a form of IsQueryBoundP.simulateQ_run_StateT_of_step that allows k queries per step, and isQueryBoundP_min (from GameHop/StateSim.lean).
  • Distribution lemmas: uniform split equivalences for Vector and BitVec, wp_uniformSample_equiv, evalDist_uniformBool_ite_true, a generalisation of boolDist_le_of_apply_le, and boolBias_le_add_two_mul_boolDist (from GameHop/Rnd.lean and GameHop/Advantage.lean).
  • Hybrids and bad events: the partition hybrid, the telescoping bound as a corollary of Measure.boolDist_le_sum_range, a potential-function bound for simulateQ, the guessing lemma, and a monotone-predicate form of the bad-event bound in Relational/SimulateQ/Resource.lean (from GameHop/GlobalHybrid.lean and GameHop/Fel.lean).
  • State projections that leave out one oracle, as generalisations of the lemmas in StateProjection.lean, plus three generic lemmas from GameHop/CompDedup.lean.
  • Eager versus lazy sampling through a lawful lens, stated with PolyFun's Lens.State and feat(OracleComp): mapLens, transporting oracle computations along lenses #1016's mapLens (merged), and once-only lazy sampling (from GameHop/Swap.lean). DeepMind's own cache types are replaced by ListCache.
  • Replay forking under a weaker hypothesis: [AnswerMeasure spec] plus uniformity at the forked index, instead of [UniformAnswerMeasure spec], in le_prEvent_isSome_contextFork and the collision lemmas, and an unfolding lemma contextFork_eq_bind_withPath. DeepMind spent about 490 lines of SignalPqxdh/XeddsaRom/ForkingReduction.lean working around the stronger hypothesis. The change is backward compatible because UniformAnswerMeasure extends AnswerMeasure. Merged refactor(ReplayFork): weaken the replay-forking bounds to uniformity at the forked index #1091, which credits DeepMind's 808b4b7 (ReplayFork.lean).
  • Modular-reduction bias: the statistical distance between (· % n) <$> $ᵗ Fin (2^k) and $ᵗ ZMod n (from ForkingReduction.lean).
  • Optional: random-oracle lemmas for an arbitrary draw under withCaching, and a test game that keeps a lazy random-oracle table in its own state, proved equal to the layered form by ListCache.adaptive_projection.

BAIF's secure-messaging stages related lemmas for VCVio in its ToVCVio library: lazy, eager and one-use sampling, bad flags and identical-until-bad simulation, PRP/PRF switching, and TV and bool-distance bounds. Compare each with DeepMind's version before porting either.

DeepMind also keeps about 450 local helper statements, mostly duplicates of VCVio API, and the largest group (279) is StateT plumbing. Those do not move. Of the 51 game-hop declarations that have a VCVio counterpart, 46 had it already at DeepMind's pin. A short guide to the simulation and StateT lemmas would likely help other users too.

Coupling up to a bad event

DeepMind proved its adapter couplings (LibsignalCli/CliPqAdapterCoupling.lean and its siblings) by manual induction. Across the repository, the proofs use inductionOn 1,036 times and RelTriple never. VCVio main has parts of the rule they needed (relTriple_simulateQ_run, DominatedUntilBad, AgreeUntilBad). It lacks a rule for two handlers with different state types, where the relation must hold only while the bad event has not happened and the error term is Pr[bad].

Verified-zkEVM/PolyFun#444 moves couplings and the relational program logic (RelWP, eRelWP, and the coupling algebra) into PolyFun, and lists a generic relational handler lift as not included. The rule above is such a lift, with the bad event kept in the postcondition. Its generic part therefore goes to PolyFun on top of Verified-zkEVM/PolyFun#444, and VCVio derives the simulateQ and RelTriple forms, as #1022 did for unary handler triples.

  • PolyFun: a relational handler lift for two stateful handlers that needs the per-query judgment only from related, non-bad states, with the event bounds and the statistical-distance bound derived from it.
  • PolyFun: a budget-indexed variant, a coupling constructor from a joint distribution whose marginals match the two sides, and restriction of the postcondition to the support of the left run.
  • VCVio: the simulateQ and RelTriple corollaries, and a small test example with the same shape as DeepMind's adapter coupling.

A quantitative form, with Pr[bad] as a state-dependent error term, would need a relational algebra at ℝ≥0∞, which Verified-zkEVM/PolyFun#444 also lists as not included. #1026 (merged) extends VCVio's until-bad bounds through a common random tail, so the VCVio corollaries reuse its lemmas.

Symmetric constructions

A new definition lands only with a construction and its security proof. DeepMind's repository contains three generic items that pass this test. Their proofs use no heartbeat or recursion-depth overrides and name their reductions. Specification paths are under LibsignalBinary/Specifications/CryptoGames/, and proof paths under Computational/Proofs/CryptoGames/.

Item New definition Construction and proof VCVio form
AEAD and Encrypt-then-MAC Deterministic AEAD with associated data and its one-time CCA game (Primitives.lean) etm_otcca (AEAD/EtM.lean): the advantage is at most the cipher's one-time IND-CPA advantage, plus one PRF advantage for the challenge tag, plus one PRF advantage per decryption query, plus qd / |T|, each against a named reduction Shaped like DetSymmEncAlg, with decryption into Option; a scheme with no associated data is the special case. The cipher is a DetSymmEncAlg and the MAC a PRFScheme; DeepMind's own cipher and MAC types do not move
CBC None: CBC is a DetSymmEncAlg cbc_indcpa (AEAD/CBC.lean): one-time IND-CPA from a PRF on blocks plus a birthday term Over a block cipher given as a keyed permutation, with the block size a parameter. Security uses the PRF advantage of the forward direction. DeepMind's version stubs decryption; the VCVio version decrypts and proves correctness
Forward-secure AEAD (FS-AEAD) The FS-AEAD scheme and game (FSAEAD/, 1,501 lines) The construction from an AEAD and a PRG, and its security theorem (FSAEAD/, 10,051 lines of proof in 14 files), with named PRG and AEAD reductions Over the AEAD above and PRGScheme. Definition, construction and theorem merge together, split into files under VCVio's 1,500-line limit

BAIF's secure-messaging proves the same one-time Encrypt-then-MAC bound (etmAEAD_security), a one-time AES-GCM bound from a PRP (gcmOneTimeAEAD_security) and Wegman–Carter MACs, and has FS-AEAD definitions with correctness. Only one Encrypt-then-MAC proof lands.

#1161 designs the multi-query, randomized counterparts (left-or-right CPA and CCA games, PRF encryption and Encrypt-then-MAC), implemented in #1164 and the draft #1165. The deterministic AEAD row should share its Encrypt-then-MAC with them rather than duplicate it.

ACD19 is Alwen, Coretti and Dodis, "The Double Ratchet: Security Notions, Proofs, and Modularization for the Signal Protocol" (ePrint 2018/1037).

PRs:

  • Deterministic AEAD, Encrypt-then-MAC, and its one-time CCA bound, in one PR.
  • CBC with decryption, correctness, and one-time IND-CPA.
  • FS-AEAD: definition, construction and security theorem, as a stack that merges together (after the AEAD PR).

Dropped, each with what would bring it back:

DeepMind definition Why it is dropped What would bring it back
Gap-DH, its strong variant, and Diffie–Hellman on curves with a cofactor No generic scheme is proved secure under it; only PQXDH uses it A generic scheme proved under Gap-CDH, such as a hashed ElGamal KEM, or a generic-group bound (#846)
KEM binding (SH-CR) and δ-correctness Assumptions about Kyber; no construction is proved to satisfy them and no generic theorem uses them A KEM proved binding or δ-correct, or a theorem that uses them
EUF-CMA with a DDH oracle, and the X25519/XEdDSA key-reuse assumption Used only as PQXDH assumptions A signature scheme proved secure in that setting
Continuous key agreement (CKA) and CKA from DDH DeepMind proves only correctness; the security proof it cites is not in the public repository A DDH-CKA security proof following ACD19. BAIF's secure-messaging has one (CKA/FromDDH/Security.lean)
PRF-PRNG Only an assumption on Signal's root key derivation A construction with a proof
The secure-messaging game and the ACD19 Double Ratchet construction The security proof imports a DeepMind-internal package A proof without that package

Conventions for these PRs:

  • Advantages use VCVio's ℝ≥0∞ boolBias. Where that differs from the paper's normalisation by a factor of 2, the docstring says so.
  • Each definition says where it departs from the paper. DeepMind marks such departures with DEV notes. For example, its one-time CCA decryption oracle refuses only the challenge pair, which is stronger than the ACD19 game; the VCVio version follows the paper or states the difference.
  • Before a PR lands, check it for hypotheses of the form ∀ A, Adv A ≤ ε on computational games. Such a hypothesis is false for unbounded adversaries and makes the theorem vacuous.

Everything specific to Signal stays in DeepMind's repository: the primitive-oracle device and byte-level DDH queries, Gap-DH over X25519 bytes and clamping, the PQXDH games, truncated HMAC and HKDF message-key derivation, the wire AEAD, and the Signal secure-messaging game and ratchet.

Cost: the DSL as one instance of the framework

DeepMind's CostedReduction (Computational/Specifications/Reductions/ReductionDsl/Core.lean) matches PolyFun's Handler.CostedReduction (Verified-zkEVM/PolyFun#396) with one particular exchange function. Its per-kind cost is a vector charge (Certified.ofDemand), and its two-stage reductions correspond to runUntil. PolyFun lacks two generic pieces, and VCVio lacks a statement shape that uses them:

Questions for Quang, Devon and Bas before the first cost PR:

  1. Who charges the reduction's own code between calls: ticks on an instrumented program in PolyFun, CatCrypt's derivation tactics, or a realization layer later. Tracking: connecting VCVio to cslib-frontier (strict PPT, VCVioFrontier, adequacy) #906 lists a cost language for reduction code as open.
  2. Whether to generalise Handler.CostedReduction in place or add a stateful structure beside it.
  3. Whether to rebase feat(GroupModel): cost certificates for handler reductions #942 onto the stateful costed reduction before it merges, or merge it and refactor later.
  4. Whether to support statements of the form "there exists a reduction R" at all, and with which description bound: a constant, DeepMind's 2^24 + 2^12 · bits(budget), or a polynomial.
  5. Whether the adversary's coin draws count against the reduction or the adversary. DeepMind's headline does not count them.
  6. Worst-case versus expected cost. feat(probability): expectations and expected charges of free programs through the fold PolyFun#445 provides both readings (expected charges and expected query counts); the open question is which one VCVio's cost statements use. Concrete versus asymptotic statements are also open (Shared cost model for reduction code (VCVio #906, PolyFun #337) lean-crypto-foundations/QuantumFoundations#5).

The docstring of each cost statement says what the bound leaves uncharged, and that per-operation prices are trusted until an adequacy theorem ties them to a machine. No name contains PPT.

Not now

Item Needs Instead
DeepMind's DSL instance in VCVio or PolyFun DeepMind The DSL stays in DeepMind's repository. The generic cost pieces go ahead with ElGamal and #942 as consumers
A costed reduction with any number of pauses A consumer other than the DSL Parked
A shared interface with Signal Shot's ACD19 definitions Another project VCVio fixes its own interfaces
Author names or header changes agreed with DeepMind DeepMind Not needed under CONTRIBUTING.md
DeepMind moving to a VCVio release and deleting its copies DeepMind An optional note after the PRs land
The secure-messaging game and the Double Ratchet construction A proof without DeepMind's internal package Dropped until such a proof exists

Related

Activity

  1. astefano commented on Nov 19, 2026

    @astefano
    Contributor

    please see that at baif, we too had results (before gdm), about aead, etm, gcm, ... the docs make it maybe easier to see our material: https://beneficial-ai-foundation.github.io/secure-messaging/
    the source code is at https://github.com/Beneficial-AI-Foundation/secure-messaging; please let us know if of interest to upstream some of our work.

  2. dtumad commented on Nov 20, 2026

    @dtumad
    Collaborator

    Thanks, @astefano. We had a look, and several parts of secure-messaging would fit well upstream:

    • from ToVCVio: PRP/PRF switching, Wegman–Carter MACs, and the bad-flag and identical-until-bad simulation lemmas;
    • the one-time AEAD theorems for Encrypt-then-MAC and GCM. Your EtM bound is the same one-time CCA result this issue planned to port from DeepMind's development, so it makes sense to land one version;
    • the security proof of CKA from DDH, which this issue lists as dropped only because no proof was available.

    Would you like to open PRs for these yourselves, or would you rather we adapt some of them here, crediting your group? Either way, ports would target current main, which is now on Lean v4.36 and takes its measure semantics from PolyFun (#1085, #1169). We may also use your proofs as a guide to where VCVio needs better automation.

  3. dtumad commented on Nov 20, 2026

    @dtumad
    Collaborator

    @quangvdao, I refreshed the body against main (7c167e88):

    Nothing else changed.

  4. astefano commented on Nov 21, 2026

    @astefano
    Contributor

    Thanks, @astefano. We had a look, and several parts of secure-messaging would fit well upstream:

    * from `ToVCVio`: PRP/PRF switching, Wegman–Carter MACs, and the bad-flag and identical-until-bad simulation lemmas;
    
    * the one-time AEAD theorems for Encrypt-then-MAC and GCM. Your EtM bound is the same one-time CCA result this issue planned to port from DeepMind's development, so it makes sense to land one version;
    
    * the security proof of CKA from DDH, which this issue lists as dropped only because no proof was available.
    

    Would you like to open PRs for these yourselves, or would you rather we adapt some of them here, crediting your group? Either way, ports would target current main, which is now on Lean v4.36 and takes its measure semantics from PolyFun (#1085, #1169). We may also use your proofs as a guide to where VCVio needs better automation.

    Thanks for taking the time to look into this. As you find it's best. I assume it's maybe smoother that the vcvio team adapts the results worth including in vcvio. If you prefer that we open prs, please let us know.

  5. dtumad commented on Nov 21, 2026

    @dtumad
    Collaborator

    @astefano I don't mind doing this myself, my main question would just be what convention you want for attribution. It seems everything is Apache(?), and I will add Authors: Beneficial AI Foundation on things, but I think a lot will naturally belong as part of larger files with many authors so just want to double check on this.

    I will also probably generalize a lot of lemmas/constructions to PolyFun, but I'll try to maintain the corresponding interface in VCVio if you eventually want to delete your copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions