Documentation

VCVio.Interaction.UC.MomentaryCorruption

Momentary corruption: the CJSV22 corruption model #

This file ships the momentary corruption model: the canonical adaptive corruption model with refresh-based healing introduced in Canetti, Jain, Swanberg, Varia, Universally Composable End-to-End Secure Messaging (CRYPTO 2022, §3.2). All names live under the MomentaryCorruption.* namespace so it is unambiguous which model (in the sense of CorruptionModel) is in scope.

The model captures:

The bundled value MomentaryCorruption.model Sid Pid is a CorruptionModel whose Event is Alphabet Sid Pid and whose State is State Sid Pid (the two-flag plus epoch tracking).

Contents #

Universe constraint #

Sid and Pid live in Type (i.e. Type 0) because State participates in ProbComp-valued reactions and ProbComp : Type → Type. Concrete protocol identity types (, String, etc.) all satisfy this bound. The two OpenProcess universes (v, w) are exposed.

Additive design #

The model is standalone: nothing here is threaded into OpenNodeProfile. Existing OpenProcess constructions are untouched. The corruption-aware composition operators (par / wire / plug lifted from OpenTheory) and the four *.corrupt forwarding lemmas (CJSV22 §4.2) live in a downstream layer that consumes Process and the model's bundled envAction; this file ships only the data and the per-event reactions.

Decidability #

All comparisons are over MachineId (which derives DecidableEq from [DecidableEq Sid] [DecidableEq Pid]) and over Epoch = ℕ. The deterministic state updates require [DecidableEq Sid] [DecidableEq Pid]; the alphabet, state, and process types themselves do not.

Alphabet and epoch #

The momentary-corruption event alphabet.

  • compromise m snapshots the current state of machine m into the adversary's view: a leakage observer (declared separately, e.g. via SnapshotLeakable) fires, and the current epoch of m is marked compromised in the bookkeeping state.
  • refresh m advances the epoch counter for m and clears the current snapshot flag. After a refresh, future epochs of m are not (yet) compromised; the protocol's forward-secrecy mechanism gets a chance to heal.

The pair (compromise, refresh) is what makes corruption momentary (rather than persistent): at any point the environment may compromise a machine, and a subsequent refresh recovers post-compromise security for future epochs.

  • compromise {Sid Pid : Type} (m : MachineId Sid Pid) : Alphabet Sid Pid

    Snapshot the current state of m into the adversary's view.

  • refresh {Sid Pid : Type} (m : MachineId Sid Pid) : Alphabet Sid Pid

    Advance the epoch counter of m, enabling forward healing.

Instances For
    def Interaction.UC.MomentaryCorruption.instDecidableEqAlphabet.decEq {Sid✝ Pid✝ : Type} [DecidableEq Sid✝] [DecidableEq Pid✝] (x✝ x✝¹ : Alphabet Sid✝ Pid✝) :
    Decidable (x✝ = x✝¹)
    Instances For
      @[implicit_reducible]

      The machine targeted by an event.

      Instances For
        @[reducible, inline]

        Epoch indexes the per-machine refresh cycles.

        A flat is the simplest concrete choice: refresh counts as epoch m += 1. Richer protocols (e.g. Signal's asymmetric ratchet with separate sending and receiving counters) can wrap this in their own Epoch-isomorphic type; the model only requires DecidableEq and a way to advance.

        Instances For

          Bookkeeping state #

          State Sid Pid packages the two-flag corruption tracking that the model carries between events.

          • corrupted m = true iff the current state of m has been snapshotted by the adversary at least once and not refreshed since. Mutated by compromise m (sets true) and refresh m (sets false).
          • compromised m e = true iff the secrets for epoch e of m are in the adversary's view. Strictly accumulating: a compromise event sets compromised m (current_epoch m); epochs once compromised stay compromised forever.
          • epoch m is m's current refresh counter. Mutated by refresh m (increments by one).

          The two flags corrupted and compromised are deliberately independent:

          • corrupted m may be false while compromised m e holds for some past e: the adversary saw that epoch's secret, but the machine has since refreshed and now has a fresh secret.
          • corrupted m may be true while compromised m e' is false for some future e': a forward-secret key schedule may forward-decrypt only a bounded window from a current compromise.

          Two flags, two distinct purposes. The naming deliberately avoids the ambiguous "exposed", which would collide with OpenTheory's boundary-exposure terminology.

          Instances For
            theorem Interaction.UC.MomentaryCorruption.State.ext {Sid Pid : Type} {x y : State Sid Pid} (corrupted : x.corrupted = y.corrupted) (compromised : x.compromised = y.compromised) (epoch : x.epoch = y.epoch) :
            x = y

            The fully-honest initial state: nothing corrupted, nothing compromised, every machine at epoch zero.

            Instances For
              @[implicit_reducible]
              def Interaction.UC.MomentaryCorruption.State.applyCompromise {Sid Pid : Type} [DecidableEq Sid] [DecidableEq Pid] (m : MachineId Sid Pid) (cs : State Sid Pid) :
              State Sid Pid

              Apply compromise m to the bookkeeping state: set corrupted m and mark the current epoch of m as compromised. The epoch counter is not advanced.

              This is a deterministic update, so the value lives in the underlying State; the canonical EnvAction reaction wraps it via pure.

              Instances For
                def Interaction.UC.MomentaryCorruption.State.applyRefresh {Sid Pid : Type} [DecidableEq Sid] [DecidableEq Pid] (m : MachineId Sid Pid) (cs : State Sid Pid) :
                State Sid Pid

                Apply refresh m to the bookkeeping state: clear corrupted m and advance the epoch counter of m by one. Past compromised flags are preserved (they are historical and accumulate).

                After a refresh, future events on m write into the new epoch; this is the structural ingredient that lets the model derive PCS (post-compromise security) as a healing theorem rather than as an axiom.

                Instances For
                  theorem Interaction.UC.MomentaryCorruption.State.corrupted_applyRefresh_of_ne {Sid Pid : Type} [DecidableEq Sid] [DecidableEq Pid] {m m' : MachineId Sid Pid} (h : m' m) (cs : State Sid Pid) :
                  @[simp]
                  theorem Interaction.UC.MomentaryCorruption.State.epoch_applyRefresh_self {Sid Pid : Type} [DecidableEq Sid] [DecidableEq Pid] (m : MachineId Sid Pid) (cs : State Sid Pid) :
                  (applyRefresh m cs).epoch m = cs.epoch m + 1
                  theorem Interaction.UC.MomentaryCorruption.State.epoch_applyRefresh_of_ne {Sid Pid : Type} [DecidableEq Sid] [DecidableEq Pid] {m m' : MachineId Sid Pid} (h : m' m) (cs : State Sid Pid) :
                  (applyRefresh m cs).epoch m' = cs.epoch m'

                  compromise is monotone: once an epoch is in the adversary's view, it stays in the adversary's view. This is the structural fact that makes PCS (post-compromise security) about future epochs rather than about un-leaking past ones.

                  @[simp]

                  refresh preserves all past compromise flags.

                  Reaction and bundled model #

                  def Interaction.UC.MomentaryCorruption.react {Sid Pid : Type} [DecidableEq Sid] [DecidableEq Pid] (s : Alphabet Sid Pid) (cs : State Sid Pid) :
                  ProbComp (State Sid Pid)

                  The canonical EnvAction reaction for the momentary-corruption alphabet: compromise snapshots, refresh advances the epoch.

                  This is the baseline used by every protocol that opts in to momentary corruption. Protocols that need richer per-event behaviour (e.g. simulator-controlled randomization on compromise, or a non-trivial leakage function) build their own EnvAction rather than overriding individual branches here.

                  Instances For

                    The canonical momentary-corruption EnvAction.

                    Instances For
                      @[simp]

                      The momentary-corruption model bundled as a CorruptionModel.

                      Use this when you want to talk about the model abstractly through the CorruptionModel API — for instance, when stating a lemma that is generic over corruption models but instantiated to the momentary case at a use site.

                      Instances For
                        @[simp]
                        @[simp]

                        Canonical corruption-aware open process #

                        @[reducible, inline]
                        abbrev Interaction.UC.MomentaryCorruption.Process (Sid Pid : Type) (m : Type w → Type w') (Δ : PortBoundary) :
                        Type (max (max (v + 1) (w + 1)) w')

                        Process Sid Pid Δ is the canonical open process for the momentary-corruption model: a MachineProcess Sid Pid Δ paired with this model's env channel.

                        Type-level definition does not depend on [DecidableEq Sid] [DecidableEq Pid]; the typeclass requirements only appear when one constructs the env action's reaction (e.g. via MachineProcess.withMomentaryCorruption).

                        Instances For

                          Wrap a MachineProcess Sid Pid Δ with the canonical momentary-corruption env channel, yielding a MomentaryCorruption.Process.

                          This is the standard inhabitant: compromise(m) snapshots m's current epoch into the adversary's view (sets corrupted m and compromised m (epoch m)), and refresh(m) advances m's epoch counter and clears corrupted m.

                          Protocols that need richer per-event behaviour (e.g. simulator-controlled randomization on compromise, or a non-trivial leakage function that depends on the protocol state) build their EnvOpenProcess directly with a bespoke EnvAction rather than going through this wrapping.

                          Instances For