Skip to main content
. 2021 Apr 19;21(8):2859. doi: 10.3390/s21082859
Algorithm 4 Fixed-Q pairing.
Input: s=6t+2, m= the bit length of s,PG1, Q=(GDBL,GADD,πQ,π2Q) (the precomputation tuple for Q, where QG2)
Output: e(P,Q)
  • 1:

    Write s in signed binary form, s=i=0m1s[i]2i with s[i]{1,0,1}

  • 2:

    f1,cnt1

  • 3:

    forim2down to 0 do

  • 4:

        λ,cGDBL[i]

  • 5:

        Compute g(yP+λxP+c)

  • 6:

        ff2·g

  • 7:

        if s[i]0 then

  • 8:

             λ,cGADD[cnt]

  • 9:

             Compute g(yP+λxP+c)

  • 10:

            cntcnt+1

  • 11:

            ff·g

  • 12:

        end if

  • 13:

    end for

  • 14:

    λ,cπQ

  • 15:

    Compute g(yP+λxP+c)

  • 16:

    ff·g

  • 17:

    λ,cπ2Q

  • 18:

    Compute g(yP+λxP+c)

  • 19:

    ff·g

  • 20:

    ff(p121)/r

  • 21:

    returnf