2005-05-18 13:17:08 +01:00
|
|
|
# Wide Mouthed Frog
|
|
|
|
#
|
|
|
|
# Modelled after the description in the SPORE library
|
|
|
|
# http://www.lsv.ens-cachan.fr/spore/wideMouthedFrog.html
|
|
|
|
#
|
|
|
|
|
|
|
|
usertype Key;
|
|
|
|
usertype TimeStamp;
|
|
|
|
|
|
|
|
secret k: Function;
|
2005-06-23 13:45:32 +01:00
|
|
|
const Fresh: Function;
|
2005-05-18 13:17:08 +01:00
|
|
|
|
|
|
|
protocol wmf(I,R,S)
|
|
|
|
{
|
2005-05-23 13:35:58 +01:00
|
|
|
role I
|
|
|
|
{
|
|
|
|
const Kir: Key;
|
2005-05-18 13:17:08 +01:00
|
|
|
const Ti: TimeStamp;
|
2005-05-23 13:35:58 +01:00
|
|
|
var Kr: Key;
|
2005-05-18 13:17:08 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
send_1(I,S, I, {Ti, R, Kir}k(I,S));
|
2005-05-18 13:17:08 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
claim_I1(I,Secret,Kir);
|
2005-06-23 13:45:32 +01:00
|
|
|
claim_I2(I,Empty,(Fresh,Kir));
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
role R
|
|
|
|
{
|
2005-05-18 13:17:08 +01:00
|
|
|
var Ts: TimeStamp;
|
|
|
|
var Kir: Key;
|
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
read_2(S,R, {Ts, I, Kir}k(R,S) );
|
2005-05-18 13:17:08 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
claim_R1(R,Secret,Kir);
|
2005-05-18 13:17:08 +01:00
|
|
|
claim_R2(R,Nisynch);
|
2005-06-23 13:45:32 +01:00
|
|
|
claim_R3(R,Empty,(Fresh,Kir));
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
2005-05-18 13:17:08 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
role S
|
|
|
|
{
|
|
|
|
var Kir: Key;
|
2005-05-18 13:17:08 +01:00
|
|
|
const Ts: TimeStamp;
|
|
|
|
var Ti: TimeStamp;
|
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
read_1(I,S, I,{Ti, R, Kir}k(I,S) );
|
2005-05-18 13:17:08 +01:00
|
|
|
send_2(S,R, {Ts, I, Kir}k(R,S));
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
2005-05-18 13:17:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const Alice,Bob,Eve,Simon: Agent;
|
|
|
|
const Ke: Key;
|
|
|
|
const Te: TimeStamp;
|
|
|
|
|
|
|
|
|
|
|
|
untrusted Eve;
|
|
|
|
compromised k(Eve,Simon);
|
|
|
|
|
|
|
|
run wmf.I (Agent,Agent,Simon);
|
|
|
|
run wmf.R (Agent,Agent,Simon);
|
|
|
|
run wmf.S (Agent,Agent,Simon);
|
|
|
|
|
|
|
|
|
|
|
|
|