LLL Algorithm
LLL Algorithm
'
&
'
Point Lattices
A point lattice is a discrete additive subgroup of Rn .
A basis for a lattice L Rn is a set of linearly independent
vectors b1 , . . . , bd Rn whose integer span generates L:
)
( d
X
xi bi : xi Z
L=
i=1
'
2D Example Lattice
h
i
h
i
The lattice generated by b1 = 3 5 and b2 = 6 0 in Z2 :
&
bb
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
bb
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
bb
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
bb
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
bb
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
bb
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
bb
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
'
A Bad Basis
b
&
'
Changing Bases
&
'
Lattice Volume
b
vol L
b
since U is unimodular.
&
'
Lattice Reduction
Some bases are much easier to work with than others. This
suggests we try to find:
A method of ranking the bases of a lattice in some desirable
order.
An efficient way to find desirable bases of a lattice when
given one of its other bases.
&
'
&
'
For example, the lattice generated by the following basis:
..
Znn
1 1 1
'
Minkowski Reduction
The next best thing:
Definition. A basis b1 , . . . , bd of L is Minkowski reduced if bi
is the shortest possible vector such that b1 , . . . , bi may be
extended into a basis of L for each 1 i d.
This is a greedy definition: it may concede a large increase in
later bi for a small decrease in an early bi .
Computationally, finding a Minkowski reduced basis leads to a
combinatorial problem with a search space exponential in d.
Even just computing b1 (the Shortest Vector Problem) is
NP-hard when the maximum norm is used.
&
10
'
Lagrange Reduction
Historically the first lattice reduction considered (by Lagrange
in 1773) was in two dimensions.
It gives rise to a simple algorithm, rather similar in style to
Euclids famous gcd algorithm: the norms of the input vectors
are continually decreased by subtracting appropriate multiples
of one vector from the other.
If kb1 k kb2 k then we want to replace b2 with b2 vb1 for
some v such that kb2 vb1 k is minimized.
&
11
'
b
b2 vb1
b
b2
b
b1
hb2 ,b1 i 1
In the case kb1 k2 2 there is no multiplier we can use to
strictly decrease the norm.
Definition. A basis b1 , b2 of L is Lagrange reduced if
hb2 ,b1 i 1
kb1 k kb2 k and kb1 k2 2 .
&
12
'
hb2 ,b1 i
kb1 k2
b1
3 on every iteration
'
Equivalently, we may consider Lagranges algorithm as if it was
using a projected lattice:
b
b
b
&
14
'
Let L be the lattice L projected orthogonally to b1 . Then
d = 1, so L has only one basis up to sign:
b
&
15
'
Now lift the basis for L into L. Of course, there are an
infinite number ways to lift; we choose the shortest.
b
b
b
&
16
'
Korkin-Zolotarev Reduction
hbi ,b1 i
kb1 k2 b1
= bi i,1 b1 .
1
2
for 2 i
'
L with basis b1 , . . . , bd
L with basis b2 , . . . , bd
(2)
(2)
Denote bi
&
18
'
Orthogonality Defect
d
Y
kbi k
i=1
d
Y
kbi k
i=1
&
d
Y
i=1
19
'
Hermite Reduction
&
20
1
2
for 2 i
'
A Nice Bound
Hermite reduced bases satisfy the following bound:
kbi k2 43 kbi k2
Intuitively this says that the projected vector bi isnt that
much smaller than the original bi .
Actually follows from the Pythagorean Theorem in d
dimensions and the fact ki,1 b1 k 21 kbi k.
b
2,1 b1
b
&
b2
b2
b1
b
21
'
kbi k2 + 14 kbi k2
kbi k2
kbi k2 43 kbi k2
4 2
(2)
2
bi
3
..
.
4 i1
3
kbi k2
&
22
'
From kbi k
defect:
4 (i1)/2
kb
ik
3
d
Y
kbi k
i=1
=
=
&
d
Y
i=1
4 (i1)/2
kb
ik
3
Pd
4
i=1 (i1)/2
3
vol L
4 d(d1)/4
vol L
3
23
'
i,j bj = rk bk +
ri bi +
si bi
x=
i=1
j=1
for some si Q.
&
24
i=1
'
k1
X
i=1
&
4 (d1)/2
3
25
4 (d1)/2
kxk.
3
'
Optimal-LLL Reduction
There is no algorithm known which can provably compute a
Hermite reduced basis efficiently (polynomial time in d). So,
we weaken the conditions again:
Definition. A basis b1 , . . . , bd of L is optimal-LLL reduced if
kb1 k kb2 k
26
1
2
for 2 i
'
kbi k2 34 kbi+1 k2 .
In fact, with a little more work we can derive the same
properties as in the Hermite case:
4 (i1)/2
kbi k
kbi k 3
d
Y
kbi k
i=1
kb1 k
4 d(d1)/4
vol L
3
4 (d1)/2
kxk
3
27
'
LLL Reduction
We weaken optimal-LLL reduction by allowing some slack
room in the kb1 k kb2 k condition:
Definition. A basis b1 , . . . , bd of L is LLL reduced with
quality parameter c (1, 4) if
kb1 k c kb2 k
1
2
for 2 i
The smaller c is, the less slack room and the better the
reduction.
&
28
'
4c
; note that C >
Define C = 4c
arbitrarily close to 43 .
4
3
i=1
29
4
3
was used, so C = 2.
'
The Punchline
The straightforward way of applying the definition of an LLL
reduced basis gives an algorithm for computing an LLL
reduced basis efficiently (polynomial time in d).
Input: A basis b1 , . . . , bd of a lattice L; a quality parameter c
Output: An LLL reduced basis of L (with quality c)
if d = 1 then return (b1 )
repeat
&
30
'
(j) (j)
Pj
bi , bj+1
bi k=1 i,k bk , bj+1
(j)
i =
(j)
2 =
2
b
b
j+1
j+1
bi , bj+1
=
b
2
j+1
= i,j+1
&
31
1
2
for j < i.
'
kbi k
c kbi+1 + i+1,i bi k
32
'
1
2
for 1 j < i d
'
'
&
After
kb1 k = kc1 k
..
.
kbk1 k = kck1 k
b1
..
.
bk1
bk+1
bk
bk+2
..
.
kbk+2 k = kck+2 k
..
.
bk+2
..
.
bd
kbd k = kcd k
bd
35
'
k
Y
kbi k2 .
i=1
d
Y
di
i=1
'
d
Y
kbi k2(di+1)
i=1
d
Y
i=1
'
&
38
'
For some constant N let L be the lattice generated by the rows
of the following basis:
0
0
b0
1
N ( ) N ( )
1
1
b1 1
N ( ) N ( )
2
2
b2 =
1
N ( ) N ( )
.
..
..
..
..
.
.
.
bm
1 N (m ) N (m )
Any x L has form x =
Pm
i=0 gi bi
for some gi Z.
&
39
'
N (g()) ,
&
40