2006-11-21 16:31:15 +00:00
|
|
|
# 1 "fourway-HSDDM05.cpp"
|
|
|
|
# 1 "<built-in>"
|
|
|
|
# 1 "<command line>"
|
|
|
|
# 1 "fourway-HSDDM05.cpp"
|
|
|
|
# 10 "fourway-HSDDM05.cpp"
|
|
|
|
usertype Params, String;
|
|
|
|
|
|
|
|
const hash: Function;
|
|
|
|
secret unhash: Function;
|
|
|
|
inversekeys(hash,unhash);
|
|
|
|
secret pmk: Function;
|
|
|
|
|
|
|
|
const msg1,msg2,msg3,msg4: String;
|
|
|
|
|
|
|
|
const Alice, Bob, Eve: Agent;
|
|
|
|
|
|
|
|
protocol fourway(X,Y)
|
|
|
|
{
|
|
|
|
role X
|
|
|
|
{
|
2012-05-02 22:01:08 +01:00
|
|
|
fresh x: Nonce;
|
2006-11-21 16:31:15 +00:00
|
|
|
var y: Nonce;
|
|
|
|
|
|
|
|
send_1( X,Y, x,msg1 );
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_2( Y,X, y,msg2,hash( hash( pmk(X,Y),x,y ),y,msg2 ) );
|
2006-11-21 16:31:15 +00:00
|
|
|
send_3( X,Y, x,msg3,hash( hash( pmk(X,Y),x,y ),x,msg3 ) );
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_4( Y,X, msg4,hash( hash( pmk(X,Y),x,y ),msg4 ) );
|
2006-11-21 16:31:15 +00:00
|
|
|
|
|
|
|
claim_X1( X, Secret, hash( pmk(X,Y),x,y ) );
|
|
|
|
claim_X2( X, Niagree );
|
|
|
|
}
|
|
|
|
|
|
|
|
role Y
|
|
|
|
{
|
|
|
|
var x: Nonce;
|
2012-05-02 22:01:08 +01:00
|
|
|
fresh y: Nonce;
|
2006-11-21 16:31:15 +00:00
|
|
|
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_1( X,Y, x,msg1 );
|
2006-11-21 16:31:15 +00:00
|
|
|
send_2( Y,X, y,msg2,hash( hash( pmk(X,Y),x,y ),y,msg2 ) );
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_3( X,Y, x,msg3,hash( hash( pmk(X,Y),x,y ),x,msg3 ) );
|
2006-11-21 16:31:15 +00:00
|
|
|
send_4( Y,X, msg4,hash( hash( pmk(X,Y),x,y ),msg4 ) );
|
|
|
|
|
|
|
|
claim_Y1( Y, Secret, hash( pmk(X,Y),x,y ) );
|
|
|
|
claim_Y2( Y, Niagree );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|