Try   HackMD

GLV Multiplication

This note explains the scalar decomposition step on the efficient EC multiplication algorithm proposed in this article.

Some implementations of the algorithm:

Here is a good explanation of the whole algorithm along with an implementation: bitcoin secp impl.

Scalar decomposition

The following homomorphism is defined:

f:Z×ZFn(i,j)i+λj where
λ
is the endoscalar of the curve.

The problem of decomposing a given scalar

kFn consists of finding a pair
(k1,k2)Z×Z
s.t.
f(k1,k2)=k
. The key of the problem is to find the shortest vector possible that satisfies this relation.

First we precompute 2 vectors

γ,β such that
f(γ)=f(β)=0
.
The problem now turns into finding a vector
v
in the lattice generated by
[β,γ]
that is close to
(k,0)
. With such vector
v
we easily compute
(k1,k2):=(k,0)v
which is short, (
max(β,γ)
) and satisfies our fist condition, since
f((k1,k2))=f((k,0))f(v)=k

Let

v:=t1β+t2γ.
We solve the system
(β1γ1β2γ2)(t1t2)=(k0)

(t1t2)=1d(γ2γ1β2β1)(k0) where
d
is the determinant of the
[γ,β]
matrix.

We get

t1=1dkγ2t2=1dkβ2

Due to the determinant division, these values lie on

Q. We round them to their closest integer value to obtain a point in the
[β,γ]
-generated lattice. Now we have:

(k1k2)=(k0)(β1γ1β2γ2)(t1t2)

We will only compute

k2:
k2=β2t1+γ2t2
Then we use the original definition
k=k1+λk2
to compute
k1
:
k1=k+λ(k2)

Finally, instead of returning

k1,k2, this algorithm will return
ki
or
ki
choosing the one with a lower absolute value. The choice is indicated with some flags. The output then is (k_1, k_1_neg, k_2, k_2_neg).