Documentation

CslibFrontier.Crypto.Protocols.UC.Reactive

Reactive Nodes and Scheduler State for Push-Style UC Execution #

This file defines the vocabulary and pure single-token scheduler transition for a push-style execution of interactive machines, modeled after the single-token activation model of [Can20a], §3.1.2 (JACM pp. 28:23–28:24) and §3.3.2, "Deleting ITIs" (JACM p. 28:33).

In this library's single-token push reading:

The operational runner built on this vocabulary lives in CslibFrontier.Crypto.Protocols.UC.PushExecution. A three-node, sufficient-fuel, output-law pull-to-push bridge from Cslib.Crypto.Protocols.UC.exec lives in CslibFrontier.Crypto.Protocols.UC.PushProperties; relating arbitrary push systems, converse simulation, timing, and general computational polynomial-time UC execution remain open under #6043.

Main definitions #

Main results #

References #

Library construction (no cited definition): the tape an external write targets (§3.1.2 of [Can20a], JACM p. 28:23: "t is a tape name out of {input, subroutine-output, backdoor}").

Instances For

    Library construction (no cited definition): a message in flight between the nodes Fin m of a push system. The runner fills in sender, so the recipient always learns it (the reveal-sender-id flag r of §3.1.2 of [Can20a], JACM p. 28:23, is fixed to 1).

    • sender : Fin m

      The node that emitted the write.

    • recipient : Fin m

      The node targeted by the write.

    • tape : TapeName

      The tape targeted by the write.

    • payload : Msg

      The message payload.

    def Cslib.Crypto.Protocols.UC.Push.instDecidableEqEnvelope.decEq {m✝ : ℕ} {Msg✝ : Type} [DecidableEq Msg✝] (x✝ x✝¹ : Envelope m✝ Msg✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]

    Library construction (no cited definition): what activates a node: the initial node's auxiliary input, a delivered envelope, or a return of control to the initial node.

    • start {m : ℕ} {Msg : Type} (input : List Bool) : Delivery m Msg

      The initial activation of the initial node with auxiliary input input.

    • deliver {m : ℕ} {Msg : Type} (envelope : Envelope m Msg) : Delivery m Msg

      Delivery of an allowed external write envelope to its recipient.

    • resume {m : ℕ} {Msg : Type} : Delivery m Msg

      Return of control to the initial node without a new message (after a disallowed write, a halted target, or a library-convention return from yield or a non-initial halt).

    @[instance_reducible]
    def Cslib.Crypto.Protocols.UC.Push.instDecidableEqDelivery.decEq {m✝ : ℕ} {Msg✝ : Type} [DecidableEq Msg✝] (x✝ x✝¹ : Delivery m✝ Msg✝) :
    Decidable (x✝ = x✝¹)

    Library construction (no cited definition): how an activation ends in this library's single-token push reading: one external write (ending the activation and, if allowed, activating its recipient; §3.1.2 of [Can20a], JACM p. 28:24), ending without a write (yield), or halting with an output bit (halt).

    • write {m : ℕ} {Msg : Type} (recipient : Fin m) (tape : TapeName) (payload : Msg) : Outcome m Msg

      Perform one external write to recipient's tape with payload.

    • yield {m : ℕ} {Msg : Type} : Outcome m Msg

      End the activation without an external write; control returns to the initial node by library convention.

    • halt {m : ℕ} {Msg : Type} (output : Bool) : Outcome m Msg

      Halt the active node with output bit output; if this is the initial node the execution ends with output (§3.1.2 of [Can20a], JACM p. 28:23), otherwise the node is recorded as halted and control returns to the initial node by library convention.

    @[instance_reducible]
    def Cslib.Crypto.Protocols.UC.Push.instDecidableEqOutcome.decEq {m✝ : ℕ} {Msg✝ : Type} [DecidableEq Msg✝] (x✝ x✝¹ : Outcome m✝ Msg✝) :
    Decidable (x✝ = x✝¹)
    @[reducible, inline]

    Library construction (no cited definition): a reactive node in a fixed m-node push system: a closed interactive machine (no oracle calls) whose activations take a Delivery and return an Outcome.

    @[reducible, inline]

    Library construction (no cited definition): a control function over the log of previously allowed write envelopes, returning true to allow a proposed write or false to disallow it (narrower than §3.1.2 of [Can20a], JACM p. 28:23, where the control function reads the entire execution prefix and may be extended to redirect writes).

    Library construction (no cited definition): a push system comprising a fixed family of m reactive nodes indexed by security parameter and node index, a distinguished initial node, and a control function (a library reading of the pair (I, C) of §3.1.2 of [Can20a], JACM p. 28:23, with the node set fixed in advance rather than dynamically invoked).

    • node : ℕ → Fin m → ReactiveNode m Msg

      The reactive node at index i for security parameter κ.

    • initial : Fin m

      The distinguished initial node.

    • control : ControlFunction m Msg

      The control function deciding whether each external write is allowed.

    Library construction (no cited definition): the scheduler's bookkeeping for a single-token push run: who is activated next and with what delivery, the log of allowed-write envelopes (appended when control permits a write, before the target is activated), the set of halted non-initial nodes, and the initial node's output bit once it has halted.

    • target : Fin m

      The node holding the activation token next.

    • delivery : Delivery m Msg

      The delivery passed to target on its next activation.

    • log : List (Envelope m Msg)

      The log of previously allowed write envelopes, appended before target activation in write order (an allowed write to a halted target is still logged before activation is skipped).

    • halted : Finset (Fin m)

      Non-initial nodes that have halted.

    • output : Option Bool

      The execution's final output bit once the initial node has halted, or none while running.

    Library construction (no cited definition): the initial scheduler state for initial node i and auxiliary input z: i is activated with .start z, the allowed-write log and halted set are empty, and no output has been produced.

    def Cslib.Crypto.Protocols.UC.Push.TokenState.next {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) :
    Outcome m Msg → TokenState m Msg

    Library construction (no cited definition): pure scheduler transition applying the active node ts.target's Outcome in push system S (in this library's push reading of [Can20a], §3.1.2 (JACM pp. 28:23–28:24) and §3.3.2, "Deleting ITIs" (JACM p. 28:33); narrower in fixed index addressing, eager initialization, forced sender-revealing writes, and a log-based control function):

    • write r t p allowed by S.control: the envelope e is appended to ts.log immediately (before r is activated; if r is already in ts.halted, e still enters ts.log and the next step skips r's handler) and r is scheduled next with .deliver e (step 1a, §3.1.2 of [Can20a], JACM p. 28:24).
    • write r t p disallowed by S.control: the write is not carried out and the initial node is activated next with .resume (§3.1.2 of [Can20a], JACM p. 28:23).
    • yield: the initial node is activated next with .resume (library convention).
    • halt b by the initial node: execution ends with output := some b (§3.1.2 of [Can20a], JACM p. 28:23).
    • halt b by a non-initial node: ts.target is recorded in ts.halted (so later activations perform no operation per §3.3.2, "Deleting ITIs", of [Can20a], JACM p. 28:33) and the initial node is activated next with .resume (library convention).
    @[simp]
    theorem Cslib.Crypto.Protocols.UC.Push.TokenState.next_write_of_control_eq_true {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) (r : Fin m) (t : TapeName) (p : Msg) (h : S.control ts.log { sender := ts.target, recipient := r, tape := t, payload := p } = true) :
    next S ts (Outcome.write r t p) = { target := r, delivery := Delivery.deliver { sender := ts.target, recipient := r, tape := t, payload := p }, log := ts.log ++ [{ sender := ts.target, recipient := r, tape := t, payload := p }], halted := ts.halted, output := ts.output }

    Library infrastructure (no cited result): rule-table equation for an allowed write.

    @[simp]
    theorem Cslib.Crypto.Protocols.UC.Push.TokenState.next_write_of_control_eq_false {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) (r : Fin m) (t : TapeName) (p : Msg) (h : S.control ts.log { sender := ts.target, recipient := r, tape := t, payload := p } = false) :
    next S ts (Outcome.write r t p) = { target := S.initial, delivery := Delivery.resume, log := ts.log, halted := ts.halted, output := ts.output }

    Library infrastructure (no cited result): rule-table equation for a disallowed write.

    @[simp]
    theorem Cslib.Crypto.Protocols.UC.Push.TokenState.next_yield {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) :
    next S ts Outcome.yield = { target := S.initial, delivery := Delivery.resume, log := ts.log, halted := ts.halted, output := ts.output }

    Library infrastructure (no cited result): rule-table equation for Outcome.yield.

    @[simp]
    theorem Cslib.Crypto.Protocols.UC.Push.TokenState.next_halt_of_target_eq {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) (b : Bool) (h : ts.target = S.initial) :
    next S ts (Outcome.halt b) = { target := ts.target, delivery := ts.delivery, log := ts.log, halted := ts.halted, output := some b }

    Library infrastructure (no cited result): rule-table equation for the initial node halting.

    @[simp]
    theorem Cslib.Crypto.Protocols.UC.Push.TokenState.next_halt_of_target_ne {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) (b : Bool) (h : ts.target ≠ S.initial) :
    next S ts (Outcome.halt b) = { target := S.initial, delivery := Delivery.resume, log := ts.log, halted := insert ts.target ts.halted, output := ts.output }

    Library infrastructure (no cited result): rule-table equation for a non-initial node halting.

    theorem Cslib.Crypto.Protocols.UC.Push.TokenState.halted_subset_next {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) (a : Outcome m Msg) :
    ts.halted ⊆ (next S ts a).halted

    Library infrastructure (no cited result): TokenState.next never removes a node from halted.

    theorem Cslib.Crypto.Protocols.UC.Push.TokenState.log_prefix_next {m : ℕ} {Msg : Type} (S : PushSystem m Msg) (ts : TokenState m Msg) (a : Outcome m Msg) :
    ts.log <+: (next S ts a).log

    Library infrastructure (no cited result): TokenState.next only appends to log.