Definition vector_secondPart_h(A : Set)(m1 m2 : nat)(v : Vector.t A (m1 + m2)) : {ls : list A | length ls = m2}.Fixpoint secondPart(A : Set)(m1 m2 : nat)(v : Vector.t A (m1 + m2)) : Vector.t A m2 :=
  of_sig_list (vector_secondPart_h m1 m2 v).Definition dotProduct(n : nat)(v1 v2 : Bvector n) :=
    Vector.fold_left2 (fun acc b1 b2 => (xorb acc (andb b1 b2))) false v1 v2.(* f' is a one-way function for vectors of length n + n *)
  Definition f'(v : Bvector (n + n)) := 
    Vector.append (f (firstPart n n v)) (secondPart n n v).Definition b(v : Bvector (n + n)) := (dotProduct (firstPart n n v) (secondPart n n v)).Definition OWP_HCP_B(v : Bvector n) : Comp (Bvector n) :=
    ret v.

(* Specifications: *)
Theorem OWP_HCP : HCP_Advantage f' b A <= (OWP_Advantage f OWP_HCP_B).