Skip to main content
. 2024 Nov 22;10:e2235. doi: 10.7717/peerj-cs.2235

Algorithm 4. Search.

Input: I,T,TKi,Q
Output: Search results R
 1: Parse {tw1,tw2,...,twt,E1,E2,..Et1}TKi,Q
 2: for twjTKj,Q do
 3:      vBI[twj];Bwj||SLwjivBH2(twj)
 4: end for
 5:  B=B1B2...Bt,r=H(B,{})
 6: Get IDB={1,2,...,p} from B
 7: for iIDB do
 8:    flag={000...000}t1,hashi=H1(t[i]),ψ=ψ+HH(r,hashi)
 9:    (E(pos11),E(pos21),E(posm1))SLw11
10:   for d=2t do
11:       (E(pos1i),E(pos2i),E(posni))SLwji
12:      for k=1m;k=1n do
13:         if E(pos1k)=E(pos1k)×E(d1) then
14:             Set the position (i1) of flag to 1
15:             break
16:         end if
17:      end for
18:   end for
19:   If all positions of flag are 1
20:   get CiT[i], RRCi
21: end for
22: Server sends { ψ} to the blockchain for verification, and sends R to the data user