src/HOL/Auth/Shared.thy
author paulson
Thu Sep 26 12:50:48 1996 +0200 (1996-09-26)
changeset 2032 1bbf1bdcaf56
parent 2012 1b234f1fd9c7
child 2064 5a5e508e2a2b
permissions -rw-r--r--
Introduction of "lost" argument
Changed Enemy -> Spy
Ran expandshort
     1 (*  Title:      HOL/Auth/Shared
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   1996  University of Cambridge
     5 
     6 Theory of Shared Keys (common to all symmetric-key protocols)
     7 
     8 Server keys; initial states of agents; new nonces and keys; function "sees" 
     9 *)
    10 
    11 Shared = Message + List + 
    12 
    13 consts
    14   shrK    :: agent => key  (*symmetric keys*)
    15 
    16 rules
    17   isSym_shrK "isSymKey (shrK A)"
    18 
    19 consts  (*Initial states of agents -- parameter of the construction*)
    20   initState :: [agent set, agent] => msg set
    21 
    22 primrec initState agent
    23         (*Server knows all keys; other agents know only their own*)
    24   initState_Server  "initState lost Server     = Key `` range shrK"
    25   initState_Friend  "initState lost (Friend i) = {Key (shrK (Friend i))}"
    26   initState_Spy   "initState lost Spy      = Key``shrK``lost"
    27 
    28 
    29 datatype  (*Messages, and components of agent stores*)
    30   event = Says agent agent msg
    31 
    32 consts  
    33   sees1 :: [agent, event] => msg set
    34 
    35 primrec sees1 event
    36            (*First agent recalls all that it says, but NOT everything
    37              that is sent to it; it must note such things if/when received*)
    38   sees1_Says  "sees1 A (Says A' B X)  = (if A:{A',Spy} then {X} else {})"
    39           (*part of A's internal state*)
    40 
    41 consts  
    42   sees :: [agent set, agent, event list] => msg set
    43 
    44 primrec sees list
    45         (*Initial knowledge includes all public keys and own private key*)
    46   sees_Nil  "sees lost A []       = initState lost A"
    47   sees_Cons "sees lost A (ev#evs) = sees1 A ev Un sees lost A evs"
    48 
    49 
    50 (*Agents generate "random" nonces.  Different traces always yield
    51   different nonces.  Same applies for keys.*)
    52 consts
    53   newN :: "event list => nat"
    54   newK :: "event list => key"
    55 
    56 rules
    57   inj_shrK      "inj shrK"
    58 
    59   inj_newN      "inj newN"
    60 
    61   inj_newK      "inj newK"
    62   newK_neq_shrK "newK evs ~= shrK A" 
    63   isSym_newK    "isSymKey (newK evs)"
    64 
    65 end