set allowDiffPatterns = true.

(********   This file has been automatically generated using the tool UKano. It encodes the frame opacity condition. ********)

(**********)
(* THEORY *)
(**********)

(* public communication channel *)
free c : channel.
free ci : channel.
free cr : channel.
free uksecret : bitstring [private].
(* constant values *)
free ok : bitstring.
free hole : bitstring.


(* Diffie-Hellman exponentiation *)
(* Symmetric Encryption *)
fun enc(bitstring, bitstring) : bitstring.
  reduc forall xm:bitstring, xk:bitstring;
        dec(enc(xm, xk), xk) = xm.
			       
(*************)
(*  *)


(* == PROTOCOL WITH IDEALISATION == *)
let SYSTEM =
( !
  new k : bitstring;
     !
      ((
        new nI: bitstring;
        out(ci, nI);
        in(ci, choice[x: bitstring,xid: bitstring]);
        let ((=nI,xnr: bitstring)) = dec(x,k) in
        new hole__xnr_I_0: bitstring;
        new hole__k_I_1: bitstring;
        out(ci, choice[enc((xnr,nI),k),enc((hole__xnr_I_0,nI),hole__k_I_1)])
      )|(
        in(cr, choice[ynI: bitstring,ynIid: bitstring]);
        new nR: bitstring;
        new hole__k_R_2: bitstring;
        out(cr, choice[enc((ynI,nR),k),enc((ynIid,nR),hole__k_R_2)]);
        in(cr, choice[y: bitstring,yid: bitstring]);
        let ((=nR,=ynI)) = dec(y,k) in
        out(cr, ok)
      ))
)
.
process SYSTEM

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