hash hmac
name sk : index -> message
name msgA : index * index -> message
name msgB : index * index -> message
abstract SIGN : message
abstract myZero : message
abstract ok : message
mutable cellA(i:index) : message = myZero
mutable cellB(i:index) : message = myZero
channel cR
channel cS
(* mySucc function for counter *)
abstract mySucc : message -> message
(* order relation for counter *)
abstract (~<) : message -> message -> bool
(* PROCESSES *)
process ReceiverA(i,j:index) =
in(cR,x);
if cellA(i) ~< fst(fst(x))
&& snd(x) = hmac(fst(x),sk(i))
then
cellA(i) := fst(fst(x));
out(cS,ok)
process ReceiverB(i,j:index) =
in(cR,x);
if cellB(i) ~< fst(fst(x))
&& snd(x) = hmac(fst(x),sk(i))
then
cellB(i) := fst(fst(x));
out(cS,ok)
process SenderA(i,j:index) =
cellA(i) := mySucc(cellA(i));
out(cR, <<cellA(i),msgA(i,j)>, hmac(<cellA(i),msgA(i,j)>,sk(i))>)
process SenderB(i,j:index) =
cellB(i) := mySucc(cellB(i));
out(cR,<<cellB(i),msgB(i,j)>, hmac(<cellB(i),msgB(i,j)>,sk(i))>)
system ((!_i !_j RA: ReceiverA(i,j)) | (!_i !_j SA: SenderA(i,j)) |
(!_i !_j RB: ReceiverB(i,j)) | (!_i !_j SB: SenderB(i,j))).
Typed-check process:
null
Added action dependencies lemmas:
System after processing:
null
System Empty registered with actions (init).
[warning>Loaded "Prelude.sp".
<]global axiom namelength_sk {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (sk i) = namelength_message]
global axiom namelength_msgA {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index * index), len (msgA i) = namelength_message]
global axiom namelength_msgB {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index * index), len (msgB i) = namelength_message]
process ReceiverA (i,j:index) =
in(cR,x);
if cellA i@τ ~< fst (fst x) && snd x = hmac (fst x, sk i) then
cellA(i) := fst (fst x); out(cS,ok); null
process ReceiverB (i,j:index) =
in(cR,x);
if cellB i@τ ~< fst (fst x) && snd x = hmac (fst x, sk i) then
cellB(i) := fst (fst x); out(cS,ok); null
process SenderA (i,j:index) =
cellA(i) := mySucc (cellA i@τ);
out(cR,<<cellA i@τ,msgA (i, j)>,hmac (<cellA i@τ,msgA (i, j)>, sk i)>);
null
process SenderB (i,j:index) =
cellB(i) := mySucc (cellB i@τ);
out(cR,<<cellB i@τ,msgB (i, j)>,hmac (<cellB i@τ,msgB (i, j)>, sk i)>);
null
Typed-check process:
( !_i( !_j( RA: ReceiverA i j)) ) |
( !_i( !_j( SA: SenderA i j)) ) |
( !_i( !_j( RB: ReceiverB i j)) ) |
!_i( !_j( SB: SenderB i j))
Added action dependencies lemmas:
axiom mutex_RB1_RB {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), not happens(RB1(i, j)) || not happens(RB(i, j))
axiom mutex_RB_RB1 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), not happens(RB(i, j)) || not happens(RB1(i, j))
axiom mutex_RA1_RA {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), not happens(RA1(i, j)) || not happens(RA(i, j))
axiom mutex_RA_RA1 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), not happens(RA(i, j)) || not happens(RA1(i, j))
axiom depends_init_SB {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(SB(i, j)) => init < SB(i, j)
axiom depends_init_RB1 {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(RB1(i, j)) => init < RB1(i, j)
axiom depends_init_RB {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(RB(i, j)) => init < RB(i, j)
axiom depends_init_SA {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(SA(i, j)) => init < SA(i, j)
axiom depends_init_RA1 {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(RA1(i, j)) => init < RA1(i, j)
axiom depends_init_RA {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(RA(i, j)) => init < RA(i, j)
System after processing:
( !_i(
!_j(
in(cR,x);
if cellA i@τ ~< fst (fst x) && snd x = hmac (fst x, sk i) then
cellA(i) := fst (fst x); RA: out(cS,ok); null
else
RA1: null)) ) |
( !_i(
!_j(
cellA(i) := mySucc (cellA i@τ);
SA: out(cR,
<<cellA i@τ,msgA (i, j)>,
hmac (<cellA i@τ,msgA (i, j)>, sk i)>);
null)) ) |
( !_i(
!_j(
in(cR,x);
if cellB i@τ ~< fst (fst x) && snd x = hmac (fst x, sk i) then
cellB(i) := fst (fst x); RB: out(cS,ok); null
else
RB1: null)) ) |
!_i(
!_j(
cellB(i) := mySucc (cellB i@τ);
SB: out(cR,
<<cellB i@τ,msgB (i, j)>,hmac (<cellB i@τ,msgB (i, j)>, sk i)>);
null))
System Empty registered with actions (init).
System default registered with actions (init,RA,RA1,SA,RB,RB1,SB).
CANAUTH
Vincent Cheval, Véronique Cortier, and Mathieu Turuani. “A Little
More Conversation, a Little Less Action, a Lot More Satisfaction: Global
States in ProVerif”. CSF 2018.
Sender -> Receiver :
<<msg,<SIGN,ctrS>>,hmac(<ctrS,msg>,sk)> ctrS :=
ctrS+1 Receiver -> Sender : input x, check x and whether ctr_received
> ctrR ctrR := ctr_received
An agent has a cell which is used to store a counter. This counter is
incremented on a send action, and set up to the reveived value on a
receive action.
HELPING LEMMAS - counter increase
SECURITY PROPERTIES - authentication on one side
******************************************************************************