2007-05-17 16:28:10 +01:00
|
|
|
/*
|
|
|
|
* Course 2r890
|
|
|
|
*
|
|
|
|
* Assignment 0405-3
|
|
|
|
*
|
|
|
|
* Protocol b
|
|
|
|
*
|
|
|
|
* not nisynch, but still niagree
|
|
|
|
*/
|
|
|
|
const pk: Function;
|
|
|
|
secret sk: Function;
|
|
|
|
inversekeys (pk,sk);
|
|
|
|
|
|
|
|
protocol course2r890year0405ex3(X,Y,I)
|
|
|
|
{
|
|
|
|
role I
|
|
|
|
{
|
2012-05-02 22:01:08 +01:00
|
|
|
fresh ni: Nonce;
|
2007-05-17 16:28:10 +01:00
|
|
|
|
|
|
|
send_1(I,X, ni );
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_2(X,I, { I,ni }sk(X) );
|
2007-05-17 16:28:10 +01:00
|
|
|
send_3(I,Y, ni );
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_4(Y,I, { ni,I }sk(Y) );
|
2007-05-17 16:28:10 +01:00
|
|
|
|
|
|
|
claim_i1(I,Niagree);
|
|
|
|
claim_i2(I,Nisynch);
|
|
|
|
}
|
|
|
|
|
|
|
|
role X
|
|
|
|
{
|
|
|
|
var nx: Nonce;
|
|
|
|
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_1(I,X, nx );
|
2007-05-17 16:28:10 +01:00
|
|
|
send_2(X,I, { I,nx }sk(X) );
|
|
|
|
}
|
|
|
|
|
|
|
|
role Y
|
|
|
|
{
|
|
|
|
var ny: Nonce;
|
|
|
|
|
2012-05-02 22:26:41 +01:00
|
|
|
recv_3(I,Y, ny );
|
2007-05-17 16:28:10 +01:00
|
|
|
send_4(Y,I, { ny,I }sk(Y) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|