STQ-SCS: An Efficient and Secure Scheme for Fine-Grained Spatial-Temporal Top- Query in Fog-Based Mobile Sensor-Cloud Systems
Algorithm 3
Completeness verification of the query result .
Ensure:;;.
Require:.
(1)
;;;
(2)
for to do
(3)
if ( contains no pairwise-key-encrypted target locations) then
(4)
Set ; return ;
(5)
end if
(6)
Decrypt all the ciphertext in with ;
(7)
if The end user cannot decrypt the ciphertext normally then
(8)
; return ;
(9)
end if
(10)
Calculate the value of which is the total number of the queried locations in ;
(11)
for to do
(12)
if is not originally in is a Data-proof Packet corresponding to which is in then
(13)
; return ;
(14)
end if
(15)
Calculate the value of which is the total number of the sensed data items in ;
(16)
ifthen
(17)
if is originally in in then
(18)
;
(19)
Continue;
(20)
else if is originally in in then
(21)
Continue;
(22)
else
(23)
; return ;
(24)
end if
(25)
end if
(26)
ifthen
(27)
ifthen
(28)
; return ;
(29)
end if
(30)
;
(31)
Continue;
(32)
end if
(33)
if ( is not included in in ) (no sensed data item in is encrypted with a sequence number) (the sequence numbers encrypted in are not sorted in ascending order from 1) (any sensed data item encrypted in is not originally encrypted with ) ( is not originally included in )then