scyther/spdl/SPORE/yahalom.spdl
gijs 56c032f4a5 Update SPORE protocols to use new ticket mechanism:
- Use builtin Ticket type instead of user type
- Remove remark that -m2 matching is required as it no longer is
2005-06-02 12:41:24 +00:00

64 lines
1.2 KiB
Plaintext

# Yahalom
#
# Modelled after the description in the SPORE library
# http://www.lsv.ens-cachan.fr/spore/yahalom.html
#
# Note:
# This protocol uses a ticket so scyther will only be able to verify
# the protocol using the ARACHNE engine (-a)
#
secret k : Function;
usertype Key;
protocol yahalom(I,R,S)
{
role I
{
const Ni: Nonce;
var Nr: Nonce;
var T: Ticket;
var Kir: Key;
send_1(I,R, I,Ni);
read_3(S,I, {R,Kir,Ni,Nr}k(I,S), T );
send_4(I,R, T, {Nr}Kir );
claim_I1(I, Secret,Kir);
claim_I2(I, Nisynch);
}
role R
{
const Nr: Nonce;
var Ni: Nonce;
var T: Ticket;
var Kir: Key;
read_1(I,R, I,Ni);
send_2(R,S, R, {I,Ni,Nr}k(R,S) );
read_4(I,R, {I,Kir}k(R,S) , {Nr}Kir );
claim_R1(R, Secret,Kir);
claim_R2(R, Nisynch);
}
role S
{
const Kir: Key;
var Ni,Nr: Nonce;
read_2(R,S, R, {I,Ni,Nr}k(R,S) );
send_3(S,I, {R,Kir,Ni,Nr}k(I,S), {I,Kir}k(R,S) );
}
}
const Alice,Bob,Simon : Agent;
run yahalom.I(Agent,Agent,s);
run yahalom.I(Agent,Agent,s);
run yahalom.R(Agent,Agent,s);