Random-oracle caches on a sum of interfaces #
Several independent lazy random oracles are one lazy random oracle on the sum of their interfaces,
answered by OracleComp.sumHandler. RandomOracle.Cache.sum joins one cache per side into a cache
of the joined interface, and a lazy call on one side of a joined cache is a lazy call on that side's
cache (answer_sum_inl, answer_sum_inr). A game that keeps one cache per oracle can therefore be
read as one represented lazy oracle.
A protocol in the random-oracle model often queries two independent oracles, such as a Merkle
hash and a Fiat–Shamir challenge oracle. RandomOracle.memoizeSum answers the calls of
spec₁ ⊕ₒ spec₂ by memoizing each side in its own association list, so that a soundness proof
can reason about the two lists separately. It implements the lazy random oracle
answer (sumHandler dist₁ dist₂) on the joined cache of the two lists
(run_interpret_memoizeSum). A program over one side touches only that side's list
(run_interpret_memoizeSum_liftLeft), and properties of each list preserved by single memoized
calls hold after every run (mem_support_run_interpret_memoizeSum).
Main definitions #
Cslib.RandomOracle.Cache.sum: the cache ofspec₁ ⊕ₒ spec₂built from one cache for each side.Cslib.RandomOracle.memoizeSum: memoize the two sides of a sum interface in two lists.
Main results #
Cslib.RandomOracle.answer_sum_inl,Cslib.RandomOracle.answer_sum_inr: a lazy call on one side of a joined cache is a lazy call on that side's cache.Cslib.RandomOracle.Cache.update_sum_inl,Cslib.RandomOracle.Cache.update_sum_inr: recording an answer in a joined cache records it on its side.Cslib.RandomOracle.mem_support_memoizeSum_inl,Cslib.RandomOracle.mem_support_memoizeSum_inr: a memoized call on one side updates only that side's list.Cslib.RandomOracle.run_interpret_memoizeSum: the two lists implement the lazy random oracle.Cslib.RandomOracle.run_interpret_memoizeSum_liftLeft,Cslib.RandomOracle.run_interpret_memoizeSum_liftRight: a program over one side uses only its own list.Cslib.RandomOracle.mem_support_run_interpret_memoizeSum: per-list invariants of supported runs.
The cache of the joined interface spec₁ ⊕ₒ spec₂: left queries read c₁, right queries read
c₂.
The responses of a joined interface are finite when both sides' responses are.
Recording a left answer in a joined cache records it in the left cache.
Recording a right answer in a joined cache records it in the right cache.
A lazy call on the left side of a joined cache is a lazy call on the left cache.
A lazy call on the right side of a joined cache is a lazy call on the right cache.
Two lazy random oracles memoized in two lists #
Answer the calls of (fun _ => R₁) ⊕ₒ (fun _ => R₂) by memoizing the left calls in the first
list, sampling from dist₁, and the right calls in the second, sampling from dist₂.
The supported outcomes of a left call are those of memoize dist₁ on the first list, with the
second list unchanged.
The supported outcomes of a right call are those of memoize dist₂ on the second list, with
the first list unchanged.
Running a left program under memoizeSum runs it under memoize dist₁ on the first list and
leaves the second list unchanged.
Running a right program under memoizeSum runs it under memoize dist₂ on the second list
and leaves the first list unchanged.
If single memoized calls preserve a property P₁ of the first list and a property P₂ of the
second, then every supported run of memoizeSum preserves both.
memoizeSum dist₁ dist₂ implements the lazy random oracle answer (sumHandler dist₁ dist₂)
on the joined cache of its two lists, preserving the result and represented final cache of every
adaptive program.
From two empty lists, memoizeSum dist₁ dist₂ has the output distribution of the lazy random
oracle answer (sumHandler dist₁ dist₂) started from the empty cache.