proposition: Theorem security_based_on_prf LA A: ValidPackage LA [interface #val #[gettag]: 'word → 'word ; #val #[checktag]: 'word × 'word → 'bool ] A_export A -> fdisjoint LA ( EVAL_locs_tt :|: EVAL_locs_ff :|: GUESS_locs :|: TAG_locs_tt :|: TAG_locs_ff :|: TAG_EVAL_locs_ff :|: TAG_GUESS_locs ) -> Advantage TAG A <= prf_epsilon (A ∘ TAG_EVAL_pkg_tt) + statistical_gap A + prf_epsilon (A ∘ TAG_EVAL_pkg_ff).
proof: Proof. move=> vA H. rewrite Advantage_E Advantage_sym. ssprove triangle (TAG true) [:: TAG_EVAL_pkg_tt ∘ EVAL true ; TAG_EVAL_pkg_tt ∘ EVAL false ; TAG_GUESS_pkg ∘ GUESS true ; TAG_GUESS_pkg ∘ GUESS false ; TAG_EVAL_pkg_ff ∘ EVAL false ; TAG_EVAL_pkg_ff ∘ EVAL true ] (TAG false) A as ineq. apply: le_trans. 1: by apply: ineq. rewrite !fdisjointUr in H. move: H => /andP [/andP [/andP [/andP [/andP [/andP [H1 H2] H3] H4] H5] H6] H7]. move: {ineq H1 H2 H3 H4 H5 H6 H7} (H1, H2, H3, H4, H5, H6, H7, fdisjoints0) => H. rewrite TAG_equiv_true ?fdisjointUr ?H // GRing.add0r. rewrite TAG_EVAL_equiv_true ?fdisjointUr ?H // GRing.addr0. rewrite TAG_EVAL_equiv_false ?fdisjointUr ?H // GRing.addr0. rewrite TAG_equiv_false ?fdisjointUr ?H // GRing.addr0. rewrite Advantage_sym. by rewrite /prf_epsilon /statistical_gap !Advantage_E !Advantage_link. Qed.
imports: Relational(OrderEnrichedCategory GenericRulesSimple) mathcomp(all_ssreflect all_algebra reals distr realsum ssrnat ssreflect ssrfun ssrbool ssrnum eqtype choice seq) Mon(SPropBase) Crypt(Axioms ChoiceAsOrd SubDistr Couplings UniformDistrLemmas FreeProbProg Theta_dens RulesStateProb pkg_core_definition choice_type pkg_composition pkg_rhl Package Prelude) extructures(ord fset fmap) Equations(Equations)