From: rtrimana Date: Tue, 2 Aug 2016 16:17:22 +0000 (-0700) Subject: Conflict in an if-statement - merging X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f37852239a8fa4261a7da81f7398417bf5338f9e;hp=d9608a8f90ac019ab6054e0c98be35a91948f99c;p=iotcloud.git Conflict in an if-statement - merging --- diff --git a/doc/iotcloud.tex b/doc/iotcloud.tex index af0a291..89c1c86 100644 --- a/doc/iotcloud.tex +++ b/doc/iotcloud.tex @@ -261,8 +261,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}$} @@ -270,8 +270,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)$ @@ -301,7 +299,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$ @@ -311,15 +309,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} @@ -420,8 +419,8 @@ $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}}}$} - \State \Call{Error}{'Invalid previous HMAC value'} + \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)$ \If{$\neg \Call{ValidHmac}{DE_g,SK,hmac_{c_g}}$} @@ -440,10 +439,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