Adaptive oracle adversaries #
An adaptive oracle adversary is a finite interaction tree: at each node it
returns a value, flips coins from a probability mass function, or asks a query
d : D and continues with the answer r : R. The query bound
OracleAdv.IsQueryBound A q states that every path of A asks at most q
queries. An adversary runs against a stateful oracle
O : S → D → PMF (R × S), which returns the answer and the next oracle state.
Main definitions #
OracleAdv D R α— adaptive adversary with queries inD, answers inR, output inαOracleAdv.IsQueryBound A q— every path ofAasks at mostqqueriesOracleAdv.run O A s— joint distribution of the output and the final oracle state whenAruns againstOfrom states
Main results #
OracleAdv.IsQueryBound.mono— query bounds are monotoneOracleAdv.run_map_state— an oracle state map that commutes with one oracle call commutes with a whole runOracleAdv.run_map_fst_of_isQueryBound_zero— an adversary without queries has an output distribution independent of the oracleOracleAdv.run_flag_apply_false_of_true— an oracle whose flag is sticky keeps it set through a runOracleAdv.run_apply_flag_false_eq— two oracles that agree on every unflagged transition give runs that agree on every unflagged outcome (identical until bad)
An adaptive oracle adversary with queries in D, answers in R and output
in α: return a value (ret), sample b from a probability mass function and
continue (rand), or query the oracle at d and continue with the answer
(query).
- ret
{D R α : Type}
: α → OracleAdv D R α
Return the output.
- rand
{D R α β : Type}
(p : PMF β)
(k : β → OracleAdv D R α)
: OracleAdv D R α
Sample from
pand continue with the sample. - query
{D R α : Type}
(d : D)
(k : R → OracleAdv D R α)
: OracleAdv D R α
Query the oracle at
dand continue with the answer.
Instances For
IsQueryBound A q: every path of A asks at most q oracle queries.
Equations
- (CatCrypt.Crypto.OracleAdv.ret a).IsQueryBound x✝ = True
- (CatCrypt.Crypto.OracleAdv.rand p k).IsQueryBound x✝ = ∀ (b : β), (k b).IsQueryBound x✝
- (CatCrypt.Crypto.OracleAdv.query d k).IsQueryBound 0 = False
- (CatCrypt.Crypto.OracleAdv.query d k).IsQueryBound n.succ = ∀ (r : R), (k r).IsQueryBound n
Instances For
The joint distribution of the output and the final oracle state when A
runs against the stateful oracle O from state s.
Equations
- CatCrypt.Crypto.OracleAdv.run O (CatCrypt.Crypto.OracleAdv.ret a) x✝ = PMF.pure (a, x✝)
- CatCrypt.Crypto.OracleAdv.run O (CatCrypt.Crypto.OracleAdv.rand p k) x✝ = p.bind fun (b : β) => CatCrypt.Crypto.OracleAdv.run O (k b) x✝
- CatCrypt.Crypto.OracleAdv.run O (CatCrypt.Crypto.OracleAdv.query d k) x✝ = (O x✝ d).bind fun (x : R × S) => CatCrypt.Crypto.OracleAdv.run O (k x.1) x.2
Instances For
A map f of oracle states that commutes with every oracle call commutes
with every run.
Without queries, the output distribution does not depend on the oracle or its initial state.
Flagged oracle state #
If an oracle never clears its flag, a run started with the flag set assigns probability zero to every outcome with the flag cleared.
Identical until bad. Two oracles on flagged states whose flags are sticky and which agree on every transition into an unflagged state give runs that agree on every unflagged outcome.