Open stateful oracle substitution #
A certified oracle program can be interpreted against a stateful handler that is itself a certified oracle program: the handler may draw private coins and call an arbitrary external stateful oracle, whose replies may be arbitrarily long. The result is again strict oracle PPT, returning the original result and the handler's final state, and it preserves the complete joint law of the result, the handler's state and the external oracle's state.
A local invariant and an efficiently computed additive allowance bound each reply given to the
program and the encoded private storage added per call. Individually efficient calls alone do
not suffice: repeatedly doubling the handler's state is efficient per call but not overall.
Closed substitution (Cslib.Probability.IsOraclePPTOn.run_interpret_preprocess) is the special
case of a sampled closed handler without external channels.
Main definitions #
Cslib.Probability.encHandlerCall: the encoded input of a stateful handler.
Main results #
Cslib.Probability.IsOraclePPTOn.run_interpret_preprocess_open: open substitution with plain captured-input preparation, a local state invariant and a plain computed resource allowance.Cslib.Probability.IsOraclePPTOn.run_interpret_preprocess_open_of_polyBounded: the same with an allowance that is only polynomially bounded, not computed.Cslib.Probability.IsOraclePPTOn.interpret_preprocess_open': stateless substitution with a polynomial-time reply allowance, retaining the arbitrary external oracle's state.Cslib.Probability.IsOraclePPTOn.interpret_bitQueries: replace each deterministic word query by a polynomial-time transformed request, keeping only one answer bit.
References #
Extends Computability/Probabilistic/OracleSimulation.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8 from closed to open handlers.
The input of a stateful oracle handler: the caller's input, then the request (an operation
and its word), then the handler's state. Each pair frames its first part, so this is
encPair input (encPair (encPair operationEncoding encBits) stateEncoding).
Substitute a stateful handler with its own external calls into an oracle program. The substituted program is strict oracle PPT and preserves the joint law of the result, the handler's final state and every external oracle's state. The allowance bounds each reply and the added encoded state, and is polynomially bounded in the encoded caller and request; it need not be computable. One invariant must hold for every possible handler result under every external oracle. External replies to the handler need no length bound.
Substitute a stateful handler with its own external calls into an oracle program. The substituted program is strict oracle PPT and preserves the joint law of the result, the handler's final state and every external oracle's state. The efficiently computed allowance bounds each reply and the added encoded state; one invariant must hold for every possible handler result under every external oracle. External replies to the handler need no length bound.
Stateless open substitution with an explicit polynomial-time bound on the replies given
back to the original program. This specializes stateful substitution to Unit; the external
oracle may still be stateful and return arbitrarily long answers.
Replacing every request by a polynomial-time computed word and reading at most one reply bit preserves strict oracle polynomial time. The certificate holds uniformly for every external stateful oracle, including oracles with arbitrarily long answers.