free e: bitstring.
free d: channel.
type key.
type host.
type nonce.

(* Shared key cryptography *)



fun encrypt(bitstring,key):bitstring.
reduc forall x:bitstring, y:key;
	let ciph = encrypt(x,y) in
	decrypt(ciph,y) = x.

type cipher.
fun c2b(cipher):bitstring [typeConverter].
fun b2c(bitstring):cipher [typeConverter].

fun enc(bitstring,key):cipher.
fun dec(bitstring,key):bitstring
reduc forall x:bitstring, y:key;
	dec(c2b(enc(x,y)),y) = x.

fun h(bitstring):bitstring.
not x:bitstring, y:key;
	let ciph = c2b(enc(x,y)) in
	attacker(h(ciph)).

process
	new a: bitstring;
	new b: bitstring;
	new k: key;
	new c: channel;
	(out(c, a) | in(c, (x:bitstring, =choice[decrypt(a,k),b])); out(d, e))


(* EXPECTPV
Error: you have given a secrecy assumption that I could not verify.
xtime: error in child process (status : 2)
END *)
