Skip to main content
. 2020 Jan 26;20(3):682. doi: 10.3390/s20030682
Algorithm 2: Level-crossing algorithm.
Require:h_^a and h_^b
Ensure: Alice and Bob’s Ka and Kb
 Alice:
  • fori=1tolength(h_^a)mdo

  • if Q(h^a[i])=Q(h^a[i+1])=Q((h^a[i+m1])) then

  •   iendlastindexinexcursion

  •   L[L;i+iend2]

  •   iiend+1

  • else

  •   ii+1

  • end if

  • end for

  • L=RandomsubsetofL

  • Alice send L to Bob PUBLIC_CHANNEL

 Bob:
  • forlLdo

  • if Q(h^b[lm22])==Q(h^b[l+m22]) then

  •   L˜[L˜;l]

  • end if

  • end for

  • Kb=Q(h^b(L˜))

  • Bob send L˜ to Alice on PUBLIC_CHANNEL

 Alice:
Ka=Q(h^a(L˜))