Abort.
End OWP_impl_HCP.
Section PseudorandomGenerator.
Variable n1 : nat.
Variable n2 : nat.
Variable f : Bvector n1 -> Bvector n2.
Hypothesis n2_greater : n2 > n1.
Variable A : Bvector n2 -> Comp bool.
Definition PRG_G1 :=
r <-$ {0, 1} ^ n1;
g <-$ (A (f r));
ret g.
Definition PRG_G2 :=
r <-$ {0, 1} ^ n2;
g <-$ (A r);
ret g.
Definition PRG_Advantage := | (Pr[PRG_G1]) - (Pr[PRG_G2]) |.
End PseudorandomGenerator.
Section OWP_HCP_Impl_PRG.
Variable n : nat.
Hypothesis n_pos : n > 0.
(* f is a one-way permutation *)
Variable f : Bvector n -> Bvector n.
Variable f_inv : Bvector n -> Bvector n.
Hypothesis f_inv1 : forall v, f (f_inv v) = v.
Hypothesis f_inv2 : forall v, f_inv (f v) = v.
(* b is a hard-core predicate for f *)
Variable b : Bvector n -> bool.
Definition OWP_HCP_PRG_fun(v : Bvector n) :=
(b v) :: (f v).
(* The PRG distinguisher adversary. *)
Variable A : Bvector (S n) -> Comp bool.
Hypothesis wf_A : forall v, well_formed_comp (A v).
Definition B (v : Bvector n)(b : bool) : Comp bool :=
(A (b :: v)).

(* Specifications: *)
(* Something equivalent to the following is in the library already, right? *)
Lemma rnd_concat_eq : forall (v : Bvector (S n)),
evalDist ({0, 1} ^ (S n)) v ==
evalDist (rb <-$ {0, 1}; r <-$ {0, 1} ^ n; ret (rb :: r)) v.