Skip to main content
. 2021 Apr 19;21(8):2859. doi: 10.3390/s21082859
Algorithm 5 Fixed-Q Product method.
Input: s=6t+2, m= the bit length of s, P={(P1,,Pd)PjG1}, Q={(Q1,,Qd)Qj is the precomputation tuple for QjG2}
Output: eprod(P,Q)
  • 1:

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

  • 2:

    f1

  • 3:

    forj1toddo

  • 4:

        cnt[j]1

  • 5:

    end for

  • 6:

    forim2down to 0 do

  • 7:

        ff2

  • 8:

        for j1 to d do

  • 9:

            GDBL,GADDQj

  • 10:

            λ,cGDBL[i]

  • 11:

            Compute g(yP+λxP+c)

  • 12:

            ff·g

  • 13:

            if s[i]0 then

  • 14:

               λ,cGADD[cnt[j]]

  • 15:

               Compute g(yP+λxP+c)

  • 16:

               cnt[j]cnt[j]+1

  • 17:

               ff·g

  • 18:

            end if

  • 19:

        end for

  • 20:

    end for

  • 21:

    forj1toddo

  • 22:

        πQ,(π)Q2Qj

  • 23:

        λ,cπQ

  • 24:

        Compute g(yP+λxP+c)

  • 25:

        ff·g

  • 26:

        λ,c(π)2Q

  • 27:

        Compute g(yP+λxP+c)

  • 28:

        ff·g

  • 29:

    end for

  • 30:

    ff(p121)/r

  • 31:

    returnf