Write-once non-erasing storage and coin exposure for adaptive UC #
This module wraps an AdaptiveProtocol in an explicit append-only per-party log and
honest-coin exposure layer (AdaptiveProtocol.withWriteOnce), motivated by the non-erasing
party model of [Can20a], Section 7.1.1 (p. 28:71, as cited in
CslibFrontier.Crypto.Protocols.UC.Adaptive).
In the base snapshot model of UC.Adaptive, AdaptiveProtocol.view is an arbitrary
caller-supplied projection that may hide stored secrets (View := Unit) or omit coins drawn and
discarded within a single activation, while recordSnapshot appends snapshots for every party
after every activation (including .net calls and other parties' activations).
AdaptiveProtocol.withWriteOnce P mem augments P's state to WriteOnceState by recording
per-party tapes i: an append-only oldest-first list of PartyActivationRecords containing the
input, output, every intra-activation ProbComp.unifFin draw (coins : OracleComp.Transcript unifSpec), and post-activation P.view snapshot for every .inl (i, x) activation of party i.
Scope #
This module extends the library's snapshot, call-bounded, fixed-n-party port model (UC.Adaptive;
#6043) and is not a formalization of full PPT interactive Turing machines with write-once
worktapes from [Can20a] §7.1.1:
- Budgets remain oracle-call counts (
PolyBounded), not running times. (P.machine κ).init : ProbComp Stateis a single shared machine initializer (unlike per-party initializers), so shared(P.machine κ).initdraws are not attributed to per-party tapestapes i.- Both honest party calls (
.inl (.party i x)) and adversary-driven calls on already-corrupted parties (.inr (.party i x)) invoke(P.machine κ).handle (.inl (i, x))behindadaptiveRouter, so both append totapes i; up to corruption time,r.current.tape(s.tapes i) holds partyi's honest-phase inputs, outputs, coins, and views without leaking activation counts of partiesj ≠ i. - While
r.current.tape(s.tapes i) is strictly per-party,(P.withWriteOnce .nonErasing).memory = .nonErasingstill populatesCorruptionReport.historyvia the outeradaptiveRouter'sAdaptiveProtocol.recordSnapshotafter every global inner activation (including.netcalls and other parties' activations).
Main definitions #
Cslib.Crypto.Protocols.UC.recordCoins,recordCoinsFrom: non-intrusiveProbComp.unifFintape instrumentation preserving execution distributions and query budgets.Cslib.Crypto.Protocols.UC.PartyActivationRecord,WriteOnceState,WriteOnceView,AdaptiveProtocol.withWriteOnce: write-once per-party tape and coin-exposure protocol wrapper.Cslib.Crypto.Protocols.UC.WriteOnceState.TapePrefix,WriteOnceRouterRel: per-party prefix ordering on tapes and router state projection relation.Cslib.Crypto.Protocols.UC.mapNetRAdversary,projectWriteOnceReport,projectWriteOnceNetR,projectWriteOnceProgram,dropWriteOnceTapeReport,dropWriteOnceTapeNetR,liftWriteOnceErasingReport,liftWriteOnceErasingNetR: adversary and program wrappers projecting, dropping, or lifting write-once tape entries.
Main results #
Cslib.Crypto.Protocols.UC.fst_map_recordCoins,isQueryBounded_recordCoins: distribution preservation and zero call-budget overhead of coin-tape recording.Cslib.Crypto.Protocols.UC.withWriteOnce_handle_inl_tapePrefix,withWriteOnce_handle_inr_tapes_eq,withWriteOnce_onCorrupt_tapes_eq,withWriteOnce_applyInitialCorruptions_eq,mem_support_closeEval_adaptiveRouter_withWriteOnce_tapePrefix: prefix monotonicity of per-party write-once tapes across party calls, network calls, corruptions, and router runs.Cslib.Crypto.Protocols.UC.AdaptiveProtocol.PolyBounded.withWriteOnce,AdaptiveAdversary.PolyBounded.mapNetR,mapNetRAdversary_comp,runFrom_adaptiveRouter_withWriteOnce_noCorrupt,adaptiveExec_withWriteOnce_project,adaptiveExec_withWriteOnce_erasing,adaptiveExec_withWriteOnce_erasing_eq: call-budget preservation, compositionality, and exact execution equivalence under honest/uncorrupted runs, report projection, erasure, and.erasinglifting.Cslib.Crypto.Protocols.UC.AdaptiveEmulatesWithin.of_writeOnce,AdaptiveEmulates.of_writeOnce,AdaptiveEmulatesWithin.erasing_of_writeOnce,AdaptiveEmulates.erasing_of_writeOnce,AdaptiveEmulatesWithin.withWriteOnce_erasing_iff,AdaptiveEmulates.withWriteOnce_erasing_iff: emulation in the.nonErasingcoin-exposing write-once model implies emulation in the projected /.erasingmodel, and for any.erasingprotocolP,P.withWriteOnce .erasingis emulation-equivalent toP.
References #
- R. Canetti, Universally Composable Security, J. ACM 67(5), Art. 28, 2020 (ePrint 2000/067 of Feb 11, 2020): Section 7.1.1 (p. 28:71), non-erasing vs. erasing parties.
Non-intrusive coin-tape instrumentation #
Execute an OracleSpec.empty-imported private-coin program starting from an initial coin
tape, appending every ProbComp.unifFin k draw ⟨k, r⟩ in oldest-first order.
Execute an OracleSpec.empty-imported private-coin program while logging every
ProbComp.unifFin draw in oldest-first order.
Forgetting the recorded coin tape from recordCoins recovers the original program
identically.
recordCoins preserves query budgets with zero overhead.
Write-once storage wrapper and monotonicity invariants #
Single party activation record appended to party i's write-once tape: input, optional
output, all ProbComp.unifFin draws sampled during that activation (coins), and party i's
post-activation P.view snapshot (postView).
- input : In
Input passed to party
ifor this activation. - output : Option Out
Output returned by party
ifor this activation, if any. - coins : OracleComp.Transcript unifSpec
Oldest-first list of
ProbComp.unifFindraws consumed during this activation. - postView : View
Inner protocol's
viewof partyiimmediately after this activation.
Instances For
Write-once, append-only state wrapper for P.machine κ.
- inner : S
Underlying inner protocol machine state.
Per-party append-only oldest-first log of
PartyActivationRecords.
View exposed upon corrupting party i under AdaptiveProtocol.withWriteOnce: combines
the inner protocol's current view with party i's complete write-once activation and coin
tape (some when .nonErasing, none when .erasing).
- current : View
Current inner-protocol view at corruption time.
Complete append-only activation and coin tape (
someiff.nonErasing).
Instances For
Per-party prefix monotonicity relation on WriteOnceState: every party's tape in s₁ is a
prefix of its tape in s₂.
Wrap an AdaptiveProtocol in explicit Canetti §7.1.1-inspired write-once per-party execution
and coin-exposure storage. Each .inl (i, x) party activation logs { input, output, coins, postView } to tapes i without modifying tapes j (j ≠ i); .inr q network/backdoor calls
leave all tapes unchanged; onCorrupt forwards to P.onCorrupt on inner while preserving all
tapes.
Every reachable post-state of an .inl (i, x) activation of P.withWriteOnce mem extends
only party i's tape by appending one PartyActivationRecord, preserves all other parties'
tapes, and satisfies TapePrefix.
Every .inr q (backdoor / network) activation of P.withWriteOnce mem leaves all per-party
write-once tapes unchanged.
Corrupting party i via (P.withWriteOnce mem).onCorrupt leaves all per-party write-once
tapes unchanged.
Applying initial corruptions C₀ to P.withWriteOnce mem modifies only inner and keeps
all per-party write-once tapes unchanged.
Across any execution of adaptiveRouter mode (P.withWriteOnce mem) κ C₀, both the per-party
write-once tapes (TapePrefix) and the corrupted party set (⊆) evolve monotonically: old
tape records and corruptions can never be erased or overwritten.
Wrapping an AdaptiveProtocol in withWriteOnce preserves its per-activation call budget
with zero overhead.
Projection equivalence and emulation implication #
Adapt an adversary talking to View₂ to talk to View₁ by transforming network replies
with f : AdaptiveNetR Out NetR View₁ → AdaptiveNetR Out NetR View₂.
Composing two network-reply adapters on an adversary equals adapting once by their composition.
Transforming network replies in an adversary preserves its call budget identically.
Project a CorruptionReport (WriteOnceView In Out View) down to a CorruptionReport View
matching target memory mode mem by discarding the write-once tape and either keeping projected
snapshot views (mem = .nonErasing) or dropping history (mem = .erasing).
Project AdaptiveNetR answers from WriteOnceView In Out View down to View under target
memory mode mem.
Adapt a program over adaptiveProtocolSpec ... View to talk to adaptiveRouter for
P.withWriteOnce, forwarding .inl party/status queries directly and projecting .inr network
replies via projectWriteOnceNetR mem.
Drop .tape and router .history from a CorruptionReport (WriteOnceView In Out View) to
recover the .erasing report of P.withWriteOnce .erasing.
Drop .tape and .history from AdaptiveNetR answers under WriteOnceView.
Lift a CorruptionReport View into CorruptionReport (WriteOnceView In Out View) for
.erasing memory mode (tape := none, history := none).
Lift AdaptiveNetR answers from View into WriteOnceView In Out View for .erasing
memory mode.
State relation between the router states of P.withWriteOnce mem and P: matching inner
protocol states, matching corrupted sets, and P.withWriteOnce's snapshot traces projecting
entrywise via .current to P's snapshot traces.
Honest-phase / uncorrupted execution transparency: for any program over adaptiveProtocolSpec
containing no .corrupt queries (in particular, all honest-party .inl and .net queries),
running against adaptiveRouter mode (P.withWriteOnce mem) κ C₀ from related states produces the
identical ProbOracleComp result and related state as running directly against
adaptiveRouter mode P κ C₀.
Projecting .corrupt reports from P.withWriteOnce mem back to P preserves the exact
ProbComp Bool execution distribution for every environment, adversary, and corruption mode,
provided mem retains router history whenever P.memory = .nonErasing.
Dropping .tape and .history in .nonErasing withWriteOnce execution yields the exact
ProbComp Bool execution of P.withWriteOnce .erasing.
For any .erasing protocol P, running P.withWriteOnce .erasing against A produces the
exact same ProbComp Bool execution as running P against
mapNetRAdversary liftWriteOnceErasingNetR A.
Concrete adaptive emulation in the coin-exposing .nonErasing write-once wrapper implies
concrete adaptive emulation of the underlying protocol P (including when P.memory = .erasing)
with identical simulator budget and error.
Asymptotic adaptive emulation in the coin-exposing .nonErasing write-once wrapper implies
asymptotic adaptive emulation of P (valid in particular when P.memory = .erasing).
Concrete adaptive emulation for P.withWriteOnce .nonErasing implies concrete adaptive
emulation for P.withWriteOnce .erasing with identical simulator budget and error.
Asymptotic adaptive emulation for P.withWriteOnce .nonErasing implies asymptotic adaptive
emulation for P.withWriteOnce .erasing.
For any .erasing protocol P, concrete adaptive emulation of P.withWriteOnce .erasing
is equivalent to concrete adaptive emulation of P with identical simulator budget and error.
For any .erasing protocol P, asymptotic adaptive emulation of P.withWriteOnce .erasing
is equivalent to asymptotic adaptive emulation of P.