import prelude;
public acknowledging : Word;
public receipt : Word;
public of : Word;
public to : Word;
type Challenge (a:Any, b:Any, text:Any)
= SophChall ( begun(b acknowledging receipt of text to a) );
type Response
= SophResp ( );
pattern Msg (b:Host)
= ( a:Host, text:Private, n:Challenge(a,b,text) );
tag msg (Msg(b)) : Auth(b:Host);
client Initiator (a:Host, b:Host, pB:PublicKey(b)) at a is
{
establish Responder at b is (socket : Socket);
new (text : Private);
new (n : Challenge(a,b,text));
output socket is {| msg(a,text,n) |}pB;
input socket is n
[ begun(b acknowledging receipt of text to a) ];
end(b acknowledging receipt of text to a);
}
server Responder (b:Host, pB:PrivateKey(b)) at b is (socket : Socket)
{
input socket is
{| msg(a:Un, text:Tainted, n:Challenge(a,b,text)) |}pB^-1;
begin(b acknowledging receipt of text to a);
output socket is n;
}
|