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,P∈G1, Q′=(GDBL,GADD,πQ,π2Q) (the precomputation tuple for Q, where Q∈G2)
Output: e(P,Q)
  • 1:

    Write s in signed binary form, s=∑i=0m−1s[i]2i with s[i]∈{−1,0,1}

  • 2:

    f←1,cnt←1

  • 3:

    fori←m−2down to 0 do

  • 4:

        λ,c←GDBL[i]

  • 5:

        Compute g←(yP+λxP+c)

  • 6:

        f←f2·g

  • 7:

        if s[i]≠0 then

  • 8:

             λ,c←GADD[cnt]

  • 9:

             Compute g←(yP+λxP+c)

  • 10:

            cnt←cnt+1

  • 11:

            f←f·g

  • 12:

        end if

  • 13:

    end for

  • 14:

    λ,c←πQ

  • 15:

    Compute g←(yP+λxP+c)

  • 16:

    f←f·g

  • 17:

    λ,c←π2Q

  • 18:

    Compute g←(yP+λxP+c)

  • 19:

    f←f·g

  • 20:

    f←f(p12−1)/r

  • 21:

    returnf