Native strict-PPT programmable random oracles #
This module implements the two semantic programming handlers from
Languages.Probabilistic.RandomOracle.Programming as word programs. One state stores the
memoized word random oracle together with arbitrary caller-defined log data. The exact per-call
laws retain the reply, cache and log jointly, so the semantic programming bounds apply without a
second probability argument.
The local resource contract separately bounds cached digest words and caller log growth. It is
stronger than polynomial time of each call: repeated calls may not multiply the encoded state.
The resulting certificates are uniform in the caller's runtime data. They do not charge a
parameter-dependent static program or machine description; concrete families with installed
program occurrences need an additional OracleTM-level description-size argument.
This is the plain-word specialization of the semantic handlers: requests, replies, coins,
queries and digests are words. The native inactive callback omits the semantic proof argument
active request = false; the semantic laws instantiate it as fun request _ log => ....
Main definitions #
Cslib.RandomOracle.ProgrammingOp,Cslib.RandomOracle.encProgrammingOp,Cslib.RandomOracle.programmingCodec: the programming and direct-hash word channels, their unary tag encoding and their typed view.Cslib.RandomOracle.ProgrammingState,Cslib.RandomOracle.encProgrammingState: one memoized word table together with an arbitrary encoded caller log.Cslib.RandomOracle.lazyProgramWordHandler,Cslib.RandomOracle.overwriteProgramWordHandler: executable closed handlers for the lazy and freshly programmed worlds.Cslib.RandomOracle.ProgrammingInvariant,Cslib.RandomOracle.programmingResources: the opaque state invariant and shared additive allowance used by source-operation adapters and whole-program certificates.
Main results #
Cslib.RandomOracle.eval_lazyProgramWordHandler,Cslib.RandomOracle.eval_overwriteProgramWordHandler: exact joint per-call laws identifying the native handlers withlazyProgramHandlerandoverwriteProgramHandler.Cslib.RandomOracle.runWith_lazyProgramWordHandler,Cslib.RandomOracle.runWith_overwriteProgramWordHandler: exact adaptive whole-run laws.Cslib.RandomOracle.isPPTOn_lazyProgramWordHandler,Cslib.RandomOracle.isPPTOn_overwriteProgramWordHandler: strict-PPT call certificates.Cslib.RandomOracle.computableInPolyTime_programmingResources,Cslib.RandomOracle.lazyProgramWordHandler_support: polynomial-time computation of the shared allowance, invariant preservation and additive encoded-state growth for supported lazy-handler calls.Cslib.RandomOracle.isPPTOn_run_lazyProgramWordHandler,Cslib.RandomOracle.isPPTOn_run_overwriteProgramWordHandler: whole-program strict-PPT certificates derived from an adversary certificate and the additive state contract.
The two word operations of a programmable random oracle. program runs the caller-defined
programming action; hash reads the memoized random oracle directly.
- program : ProgrammingOp
Run the programming action.
- hash : ProgrammingOp
Query the random oracle directly.
Instances For
Typed programming requests (.inl) and direct hash queries (.inr) on the two named word
channels. Replies on both channels are words.
Native state of a programmable word random oracle: an association-list cache of query/digest words and an arbitrary caller log.
Memoized query/digest words. The first occurrence of a query is authoritative.
- log : Log
Caller-defined data updated by programming requests.
Encoding of a programmable state: the framed cache encoding followed by the caller log. Each cache entry contains its framed query word followed by its digest word.
Executable lazy programmable word oracle. Active programming calls sample preimage coins,
query the memoized random oracle at the computed point and update the caller log. Inactive calls
run inactive; direct hash calls use the same cache.
Executable freshly programmed word oracle. It differs from lazyProgramWordHandler only on
active programming calls, which sample a fresh digest and prepend the computed point without a
cache lookup.
A native lazy-programming call has exactly the joint reply/cache/log law of
lazyProgramHandler, through programmingCodec.
A native overwrite-programming call has exactly the joint reply/cache/log law of
overwriteProgramHandler, through programmingCodec.
Adaptive typed execution against lazyProgramHandler has exactly the joint result/cache/log
law of native execution against lazyProgramWordHandler.
Adaptive typed execution against overwriteProgramHandler has exactly the joint
result/cache/log law of native execution against overwriteProgramWordHandler.
Strict-PPT certificates #
The lazy programmable word handler is strict PPT when each caller component is. The certificate charges the complete incoming and returned cache and log.
The overwrite programmable word handler is strict PPT when each caller component is. The certificate charges the complete incoming and returned cache and log.
Per-call resource contract #
State invariant used by the programmable-oracle resource contract: cached digests satisfy the
caller bound and the caller-defined log invariant holds. The representation is kept opaque; use
ProgrammingInvariant.intro to establish it.
Establish the programmable state invariant from its cache and log obligations.
Additive allowance for one programmable-oracle call. It charges the reply and request words, the programmed point, the sampled digest, fixed framing overhead and caller log growth.
The shared per-call allowance is polynomial-time computable from certificates for its four caller-supplied bounds. This lets finite source-operation adapters take maxima of the opaque allowance at their framed payloads without duplicating its formula.
Every supported lazy programmable-oracle call preserves ProgrammingInvariant, bounds the
reply word and grows the complete encoded cache/log state by at most programmingResources.
Whole-program strict-PPT certificates #
Running a uniform strict oracle-PPT program against the lazy programmable word handler is
strict PPT, including its final cache and log. The component bounds form a local additive
storage contract. This theorem charges runtime caller data but not a parameter-dependent static
description of program; such descriptions require a separate OracleTM-level size argument.
Running a uniform strict oracle-PPT program against the overwrite programmable word handler
is strict PPT, including its final cache and log. It uses the same local additive resource
contract and the same static-description-size limitation as
isPPTOn_run_lazyProgramWordHandler.