X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=doc%2Fiotcloud.tex;fp=doc%2Fiotcloud.tex;h=af0a291b64697fc06ef819aa3ac9d517d55f9cd7;hb=d9608a8f90ac019ab6054e0c98be35a91948f99c;hp=ab9cf8521caed7972aebc8d38e86370450f12068;hpb=21d1d65712c836839d97d0f34bbe182a4e87815d;p=iotcloud.git diff --git a/doc/iotcloud.tex b/doc/iotcloud.tex index ab9cf85..af0a291 100644 --- a/doc/iotcloud.tex +++ b/doc/iotcloud.tex @@ -519,13 +519,13 @@ $\tuple{ck,\tuple{k, v}} \in KV_s \wedge \forall \tuple{ck_s,\tuple{k_s, v_s}} \in KV_s, k = k_s$ \\ \begin{algorithmic}[1] -\Function{PutKVPair}{$KV_s,\tuple{k_s,v_s}$} -\State $\tuple{ck_s,\tuple{k_s,v_t}} \gets GetKV(KV_s,k_s)$ +\Function{PutKVPair}{$\tuple{k_s,v_s}$} +\State $\tuple{ck_s,\tuple{k_s,v_t}} \gets GetKV(KV,k_s)$ \If{$\tuple{ck_s,\tuple{k_s,v_t}} = \emptyset$} - \State $KV_s \gets KV_s \cup \{\tuple{ck_p, \tuple{k_s,v_s}}\}$ + \State $KV \gets KV \cup \{\tuple{ck_p, \tuple{k_s,v_s}}\}$ \State $ck_p \gets ck_p + 1$ \Else - \State $KV_s \gets (KV_s - \{\tuple{ck_s, \tuple{k_s,v_t}}\}) \cup + \State $KV \gets (KV - \{\tuple{ck_s, \tuple{k_s,v_t}}\}) \cup \{\tuple{ck_s, \tuple{k_s,v_s}}\}$ \EndIf \State \Return{$KV_s$} @@ -578,16 +578,24 @@ $\tuple{ck,\tuple{k, v}} \in KV_s \wedge \end{algorithmic} \begin{algorithmic}[1] -\Function{ReinsertLastSlot}{$sl_{s_{last}},max'_s$} - \State $s_s \gets GetLastS(sl_{s_{last}})$ - \State $sv_s \gets GetSV(sl_{s_{last}})$ - \State $\tuple{stat_s,SL_s} \gets \Call{PutSlot}{s_s,sv_s,max'_s}$ - \State $cr_s \gets \Call{HandleCollision}{\tuple{stat_s,SL_s}}$ -\State \Return{$cr_s$} + +\Function{ReinsertLastSlot}{$MS_s,SK_s,sl_{s_{last}},max'_s,hmac_{p_s}$} +\State $s_s \gets MaxLastSeqN(MS_s)$ +\State $sv_s \gets GetSV(sl_{s_{last}})$ +\State $Dat_s \gets Decrypt(SK,sv_s)$ +\State $DE_s \gets GetDatEnt(Dat_s)$ +\State $hmac_{c_s} \gets Hmac(DE_s,SK_s)$ +\State $Dat_s \gets CreateDat(s_s,id_{self},hmac_{p_s},DE_p,hmac_{c_s})$ +\State $hmac_{p_s} \gets hmac_{c_s}$ +\State $\tuple{stat_s,SL_s} \gets \Call{PutSlot}{s_s,sv_s,max'_s}$ +\State $cr_s \gets \Call{HandleCollision}{\tuple{stat_s,SL_s}}$ +\State \Return{$\tuple{cr_s,hmac_{p_p}}$} + \EndFunction \end{algorithmic} \note{Shouldn't this function do something pretty sophisticated about seeing what data we actually need to keep from the last slot and not just insert the entire thing?} +\note{Probably best to just not call this function if $need_s$ is false and not pass in such parameters. It makes it harder to read.} \begin{algorithmic}[1] \Function{GetDEPairs}{$KV_s,max'_s,need_s,sl_s$}