Machine identity for UC composition #
This file introduces MachineId Sid Pid, the (sid, pid) machine identity
used to address protocol participants in CJSV22-style universal composition
(Canetti, Jain, Swanberg, Varia, Universally Composable End-to-End Secure
Messaging, CRYPTO 2022). A machine is identified by a session identifier
sid : Sid and a party identifier pid : Pid. Within a single instantiated
session, party identifiers distinguish participants; across sessions, the
session identifier scopes who is allowed to talk to whom.
The framework's OpenProcess Party Δ is generic in its participant type
Party. Specializing Party := MachineId Sid Pid recovers the CJSV22 surface
where every protocol input and output is keyed by a (sid, pid) pair. The
abbreviation MachineProcess Sid Pid Δ names that specialization.
MachineId is intentionally additive: nothing in the existing UC layer
mentions it, and protocols that already use a flat Party continue to work
unchanged. New work that needs session-aware identity (forward security,
post-compromise security, multi-session composition) instantiates
Party := MachineId Sid Pid and uses the helpers below.
Per-process access control and subroutine respecting #
This file also introduces the access-control vocabulary required by the CJSV22 subroutine respecting condition:
HasAccessControl P. A typeclass overOpenProcess Party Δcarryingallowed : Interface.RoutedPacket Δ.In Party → Bool. The default-open instanceHasAccessControl.allowAllis provided for protocols whose security is not sensitive to per-machine input filtering.MachineProcess.allowSameSession owner P. The canonical CJSV22 filter on aMachineProcess: admit a routed packet iff its sender shares a session withowner(perMachineId.sameSession).MachineProcess.SubroutineRespectingAt sid P. AProp-valued property saying every reachable step's decoration only attributes controllers in sessionsid. Built recursively overSpec.DecorationviaOpenNodeProfile.SessionCoherentAtMoveandDecorationSessionCoherentAt.
These three pieces are additive on top of the existing OpenProcess
surface: no existing construction site is touched, and the predicate
SubroutineRespectingAt reads off the controller annotations already
carried by OpenNodeContext.
Deferred follow-up #
The runtime integration that consults HasAccessControl from
BoundaryAction.inputDecode is deliberately deferred to the
corruption layer, which already needs to touch the boundary surface
for EnvAction dispatch. Until that integration lands,
HasAccessControl is a declarative contract that downstream
constructions thread by hand: the typeclass exposes the per-process
allowed predicate, but no construction in this file enforces it
against the runtime. Consumers that need the contract enforced should
filter incoming routed packets explicitly through allowed at the
appropriate boundary surface.
MachineId Sid Pid is the standard (sid, pid) machine identity from
CJSV22's universal composition with global subroutines.
Two machines are equal iff both their session identifier and party identifier
agree. Decidable equality is derived from decidable equality on Sid and
Pid.
The session identifier Sid is left abstract so users can pick the structure
that fits their composition style: a flat Nat or String for single-level
sessions, or a List String / prefix tree when nested subsessions need to
be addressed by hierarchical paths (the standard CJSV22 idiom for spawned
subprotocols).
- sid : Sid
- pid : Pid
Instances For
Instances For
Two machines belong to the same protocol session iff their session identifiers agree.
This is the syntactic ingredient of CJSV22's "subroutine respecting" check:
within a subroutine respecting protocol, a machine routes inbound and outbound
messages only between machines sharing its sid.
Instances For
MachineProcess Sid Pid Δ is the specialization of OpenProcess to processes
whose participants are identified by (sid, pid) machine identities.
This is the canonical type for protocols written in the CJSV22 idiom: every
input and output packet is keyed by a MachineId Sid Pid, and session-scoped
composition operates uniformly over this type.
Existing examples that use a flat Party are unaffected; only protocols that
need session-aware identity instantiate this abbreviation.
Instances For
Per-process access control #
HasAccessControl P is the per-process predicate deciding which routed
inbound packets are admissible to the open process P.
For an open process P : OpenProcess Party Δ, an instance supplies
allowed : Interface.RoutedPacket Δ.In Party → Bool. The runtime layer
consults this typeclass when delivering inbound packets: a packet is
forwarded to P only when allowed rp = true.
The default for new instances is allow everything (HasAccessControl.allowAll).
Protocols that need sender-aware filtering provide a more restrictive
instance. The canonical CJSV22-style filter
(MachineProcess.allowSameSession) admits a packet iff its sender shares a
session with the process owner, recovering the access-control fragment of
the subroutine respecting condition (CJSV22 §2.3).
The runtime integration into BoundaryAction.inputDecode is deliberately
not wired up in this slice: the typeclass exists as a forward-compatible
vocabulary that downstream layers (notably the F2 corruption work) consume.
Until that integration lands, HasAccessControl is a declarative contract
that downstream constructions must thread by hand.
- allowed : Δ.In.RoutedPacket Party → Bool
Instances
The trivial allow-all access control: every routed packet is admissible.
Useful for protocols whose security does not depend on per-machine input filtering, and as the canonical baseline against which more restrictive instances are compared.
Instances For
The canonical CJSV22 same-session access control on a MachineProcess.
MachineProcess.allowSameSession owner P admits a routed packet iff its
sender shares a session with owner (per MachineId.sameSession).
This is the access-control fragment of the subroutine respecting
condition (CJSV22 §2.3): a machine (s, p) only accepts inputs from
senders whose session identifier is also s. Combined with a sender-aware
emit (delivered by F2), this recovers the full structural same-session
discipline.
Instances For
Subroutine respecting predicate #
A node semantics is session-coherent at sid for a chosen move x
iff every controller listed by the node for that move resides in
session sid.
This is the per-move check used by DecorationSessionCoherentAt: at the
node where x is chosen, every machine credited as a controller of x
must share the protocol's session identifier.
Instances For
A spec decoration is session-coherent at sid along a chosen
transcript iff every visited node attributes only controllers in
session sid.
This is the recursive companion to
OpenNodeProfile.SessionCoherentAtMove, modeled directly on
IsSilentDecoration: the predicate walks the same transcript path
through the decoration tree and accumulates the per-node coherence
checks.
Instances For
A MachineProcess is subroutine respecting at sid iff every step
from every reachable state, along every transcript path, only attributes
controllers in session sid.
This is the controller-side fragment of CJSV22's subroutine
respecting condition. The sender-side fragment (every emitted /
accepted RoutedPacket has sender in session sid) lives at the
BoundaryAction integration layer and is enforced by future
HasAccessControl instances installed via
MachineProcess.allowSameSession.