free c:channel.
free d:channel [private].

fun h(bitstring):bitstring.

const a,b:bitstring.

event A(bitstring).
event B(bitstring).

const ok,ko,k:bitstring[private].

(*nounif x:bitstring, y:bitstring;
  mess(d,choice[x,*y]).
*)

nounif x:bitstring; mess(c,( *x,x)).

not x:bitstring; attacker((new k[x = choice[a,b]],x)).

process
  !(in(c,x:bitstring);
  in(c,y:bitstring);
  if x = a
  then
    new k:bitstring;
    event A(choice[a,a]);
    out(d,k)
  else
    out(c,ko))

  | in(d,x:bitstring); out(c,ok)

(* EXPECTPV
RESULT Observational equivalence is true.
0.012s (user 0.012s + system 0.000s), max rss 8656K
END *)
