From 2603503e159a14f0a41fc042f5fff201280d286d Mon Sep 17 00:00:00 2001 From: rtrimana Date: Tue, 2 Aug 2016 09:15:16 -0700 Subject: [PATCH] Small changes in client reading slots part - to be verified by Thomas --- doc/iotcloud.tex | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/doc/iotcloud.tex b/doc/iotcloud.tex index 450d913..99840ea 100644 --- a/doc/iotcloud.tex +++ b/doc/iotcloud.tex @@ -259,8 +259,6 @@ $MinLastSeqN(MS_s)= s_{last}$ \textit{such that} $\tuple{id, s_{last}} \in MS_s \EndProcedure \end{algorithmic} -\note{Don't include ``such that'' in the argument of a function...} - \begin{algorithmic}[1] \Function{ValidHmac}{$DE_s,SK_s,hmac_{stored}$} \State $hmac_{computed} \gets Hmac(DE_s,SK_s)$ @@ -269,8 +267,8 @@ $MinLastSeqN(MS_s)= s_{last}$ \textit{such that} $\tuple{id, s_{last}} \in MS_s \end{algorithmic} \begin{algorithmic}[1] -\Function{ValidPrevHmac}{$DE_s,hmac_{p_s},hmac_{p_{sto}}$} -\If{$hmac_{p_s} = \emptyset$}\Comment{First slot - no previous HMAC} +\Function{ValidPrevHmac}{$s_s,DE_s,hmac_{p_s},hmac_{p_{sto}}$} +\If{$s_s = 0 \land hmac_{p_s} = \emptyset$}\Comment{First slot - no previous HMAC} \State \Return $true$ \Else \State \Return {$hmac_{p_{sto}} = hmac_{p_s}$} @@ -278,8 +276,6 @@ $MinLastSeqN(MS_s)= s_{last}$ \textit{such that} $\tuple{id, s_{last}} \in MS_s \EndFunction \end{algorithmic} -\note{So if a slot has a null previous hmac, everything is fine? What if it isn't the first slot?} - \begin{algorithmic}[1] \Function{GetQueSta}{$Dat_s$} \State $DE_s \gets GetDatEnt(DE_s)$ @@ -309,7 +305,7 @@ $MinLastSeqN(MS_s)= s_{last}$ \textit{such that} $\tuple{id, s_{last}} \in MS_s \end{algorithmic} \begin{algorithmic}[1] -\Function{GetColRes}{$Dat_s$}\Comment{At most 2 $cr$ entries in a slot} +\Function{GetColRes}{$Dat_s$} %\Comment{At most 2 $cr$ entries in a slot} \State $DE_s \gets GetDatEnt(Dat_s)$ \State $de_{cr} \gets de_s$ \textit{such that} $de_s \in DE_s, de_s \in D \land de_s = cr$ @@ -319,15 +315,16 @@ $MinLastSeqN(MS_s)= s_{last}$ \textit{such that} $\tuple{id, s_{last}} \in MS_s \State $\tuple{s_{ret},id_{ret}} \gets \emptyset$ \EndIf -\State $de_{r_{cr}} \gets de_s$ \textit{such that} $de_s \in DE_s, - de_s \in D \land de_s = cr \land de_s \neq de_{cr}$ -\If{$de_{r_{cr}} \neq \emptyset$} - \State $\tuple{s_{r_{ret}},id_{r_{ret}}} \gets GetCR(de_{r_{cr}})$ -\Else - \State $\tuple{s_{r_{ret}},id_{r_{ret}}} - \gets \emptyset$ -\EndIf -\State \Return{$\{\tuple{s_{ret},id_{ret}},\tuple{s_{r_{ret}},id_{r_{ret}}}\}$} +%\State $de_{r_{cr}} \gets de_s$ \textit{such that} $de_s \in DE_s, +% de_s \in D \land de_s = cr \land de_s \neq de_{cr}$ +%\If{$de_{r_{cr}} \neq \emptyset$} +% \State $\tuple{s_{r_{ret}},id_{r_{ret}}} \gets GetCR(de_{r_{cr}})$ +%\Else +% \State $\tuple{s_{r_{ret}},id_{r_{ret}}} +% \gets \emptyset$ +%\EndIf +%\State \Return{$\{\tuple{s_{ret},id_{ret}},\tuple{s_{r_{ret}},id_{r_{ret}}}\}$} +\State \Return{$\{\tuple{s_{ret},id_{ret}}\}$} \EndFunction \end{algorithmic} @@ -442,7 +439,7 @@ $MinLastSeqN(MS_s)= s_{last}$ \textit{such that} $\tuple{id, s_{last}} \in MS_s \EndIf \State $DE_g \gets GetDatEnt(Dat_g)$ \State $hmac_{p_{stored}} \gets GetPrevHmac(Dat_g)$ - \If{$\neg \Call{ValidPrevHmac}{DE_g,hmac_{p_g},hmac_{p_{stored}}}$} + \If{$\neg \Call{ValidPrevHmac}{s_g,DE_g,hmac_{p_g},hmac_{p_{stored}}}$} \State \Call{ReportError}{'Invalid previous HMAC value'} \EndIf \State $hmac_{c_g} \gets GetCurrHmac(Dat_g)$ @@ -462,10 +459,11 @@ $MinLastSeqN(MS_s)= s_{last}$ \textit{such that} $\tuple{id, s_{last}} \in MS_s \If{$\tuple{id_d,s_{d_{last}}} \neq \emptyset$} \State $MS_g \gets \Call{UpdateLastSeqN}{id_d,s_{d_{last}},MS_g}$ \EndIf - \State $\{\tuple{s_e,id_e},\tuple{s_f,id_f}\} \gets - \Call{GetColRes}{Dat_g}$\Comment{Handle cr} + %\State $\{\tuple{s_e,id_e},\tuple{s_f,id_f}\} \gets + % \Call{GetColRes}{Dat_g}$\Comment{Handle cr} + \State $\{\tuple{s_e,id_e}\} \gets \Call{GetColRes}{Dat_g}$\Comment{Handle cr} \State $\Call{CheckCollision}{MS,SM,\tuple{s_e,id_e}}$\Comment{From normal slot} - \State $\Call{CheckCollision}{MS,SM,\tuple{s_f,id_f}}$\Comment{From reinsertion} + %\State $\Call{CheckCollision}{MS,SM,\tuple{s_f,id_f}}$\Comment{From reinsertion} \State $sl_{last} \gets \Call{StoreLastSlot}{MS,sl_{last},s_g,sv_g,id_g}$ \State $DT \gets \Call{UpdateDT}{DT,Dat_g}$ \EndFor -- 2.34.1