Documentation

PolyFun.Interaction.Open.MomentaryCorruption

Momentary-corruption bookkeeping #

MomentaryCorruption tracks compromise flags and refresh counters for identities in an arbitrary type M. The deterministic updates have the following effects:

react returns these updates through pure, and model M m bundles them as a CorruptionModel m. OpenProcess.withMomentaryCorruption pairs an open process with this reaction on a separate bookkeeping state. Connecting events to protocol-state observations, secret updates, or execution scheduling requires consumer-supplied semantics. The definitions and equations here establish no post-compromise security or leakage guarantee.

Identity and universes #

The alphabet, state, and process types accept any M : Type; the updates and canonical reaction require [DecidableEq M]. Pair identities can be supplied as M := Sid × Pid. No session structure is used by the updates.

The identity and bookkeeping types live in Type 0, matching the input universe of m : Type → Type w' in CorruptionModel. The process-state universe v and the monad-output universe w' remain independent.

References #

CJSV22, Universally Composable End-to-End Secure Messaging, motivates the compromise/refresh vocabulary; see REFERENCES.md. Its protocol-specific recovery arguments require secret-state semantics and key evolution beyond the bookkeeping implemented here.

Alphabet and epoch #

Events selecting the compromise or refresh update for an identity. Their interpretation on bookkeeping state is given by react.

  • compromise {M : Type} (m : M) : Alphabet M

    Mark the current epoch of m as compromised.

  • refresh {M : Type} (m : M) : Alphabet M

    Advance the epoch counter of m and clear its current corruption flag.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[reducible, inline]

      The natural-number counter advanced by each refresh of an identity.

      Equations
      Instances For

        Bookkeeping state #

        Flags and counters carried between events.

        The structure admits arbitrary field values. Relating the flags to an event history requires a reachability invariant from State.init; relating them to an observer's knowledge requires a separate semantic interpretation.

        • corrupted : M → Bool

          Current corruption flag, set by compromise and cleared by refresh.

        • compromised : M → Epoch → Bool

          Per-(identity, epoch) compromise flag, preserved by both updates once true.

        • epoch : M → Epoch

          Per-machine refresh counter, advanced by refresh.

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

          The initial bookkeeping state: all flags false and every epoch counter zero.

          Equations
          Instances For

            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.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Clear corrupted m and advance the epoch counter of m by one. The entire compromised function is preserved, regardless of the recorded epochs. Subsequent compromise events mark the new current epoch.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Compromise preserves every flag that was already set, for any identity and epoch.

                @[simp]

                Refresh preserves all compromise flags.

                Reaction and bundled model #

                The canonical momentary-corruption EnvAction.

                Equations
                Instances For
                  @[simp]
                  @[simp]
                  theorem Interaction.Open.MomentaryCorruption.react_refresh {M : Type} [DecidableEq M] {m : Type → Type w'} [Pure m] (m₀ : M) (cs : State M) :

                  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.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Canonical corruption-aware open process #

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

                    Open processes over M paired with a reaction on Alphabet M and State M. Each value supplies its reaction; OpenProcess.withMomentaryCorruption supplies the canonical envAction.

                    The type requires only [Pure m]. Constructing the canonical reaction additionally requires [DecidableEq M].

                    Equations
                    Instances For

                      Pair an open process with MomentaryCorruption.envAction on a separate MomentaryCorruption.State M. The underlying process is preserved definitionally; events update only the bookkeeping state passed to react.

                      Equations
                      Instances For