[go: nahoru, domu]

Jump to content

Lattice reduction: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Cdcdb (talk | contribs)
No edit summary
 
(27 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Image:Lattice-reduction.svg|thumb|right|300px|Lattice reduction in two dimensions: the black vectors are the given basis for the lattice (represented by blue dots), the red vectors are the reduced basis]]
[[Image:Lattice-reduction.svg|thumb|right|300px|Lattice reduction in two dimensions: the black vectors are the given basis for the lattice (represented by blue dots), the red vectors are the reduced basis]]
In mathematics, the goal of '''lattice basis reduction''' is given an integer [[lattice (group)|lattice]] basis as input, to find a [[basis (linear algebra)|basis]] with short, nearly [[orthogonal]] vectors. This is realized using different algorithms, whose running time is usually at least exponential in the dimension of the lattice.
In mathematics, the goal of '''lattice basis reduction''' is to find a [[basis (linear algebra)|basis]] with short, nearly [[orthogonal]] vectors when given an integer [[lattice (group)|lattice]] basis as input. This is realized using different algorithms, whose running time is usually at least exponential in the dimension of the lattice.


==Nearly Orthogonal==
==Nearly orthogonal==
One measure of ''nearly orthogonal'' is the '''orthogonality defect'''. This compares the product of the lengths of the basis vectors with the volume of the [[parallelepiped]] they define. For perfectly orthogonal basis vectors, these quantities would be the same.
One measure of ''nearly orthogonal'' is the '''orthogonality defect'''. This compares the product of the lengths of the basis vectors with the volume of the [[parallelepiped]] they define. For perfectly orthogonal basis vectors, these quantities would be the same.


Line 13: Line 13:
From the geometric definition it may be appreciated that <math>\delta(B) \ge 1</math> with equality if and only if the basis is orthogonal.
From the geometric definition it may be appreciated that <math>\delta(B) \ge 1</math> with equality if and only if the basis is orthogonal.


If the lattice reduction problem is defined as finding the basis with the smallest possible defect, then the problem is [[NP complete]]. However, there exist [[polynomial time]] algorithms to find a basis with defect <math>\delta(B) \le c</math>
If the lattice reduction problem is defined as finding the basis with the smallest possible defect, then the problem is [[NP-hard]] {{Citation needed|reason=This seems too strong, as, for example the Shortest Vector Problem is only known to be NP-hard under randomized reductions.|date=July 2022}}. However, there exist [[polynomial time]] algorithms to find a basis with defect <math>\delta(B) \le c</math>
where ''c'' is some constant depending only on the number of basis vectors and the dimension of the underlying space (if different). This is a good enough solution in many practical applications.
where ''c'' is some constant depending only on the number of basis vectors and the dimension of the underlying space (if different){{Citation needed|date=July 2022}}. This is a good enough solution in many practical applications{{Citation needed|date=July 2022}}.


==In two dimensions==
==In two dimensions==
For a basis consisting of just two vectors, there is a simple and efficient method of reduction closely analogous to the [[Euclidean algorithm]] for the [[greatest common divisor]] of two integers. As with the Euclidean algorithm, the method is iterative; at each step the larger of the two vectors is reduced by adding or subtracting an integer multiple of the smaller vector.
For a basis consisting of just two vectors, there is a simple and efficient method of reduction closely analogous to the [[Euclidean algorithm]] for the [[greatest common divisor]] of two integers. As with the Euclidean algorithm, the method is iterative; at each step the larger of the two vectors is reduced by adding or subtracting an integer multiple of the smaller vector.

The pseudocode of the algorithm, often known as Lagrange's algorithm or the Lagrange-Gauss algorithm, is as follows:

Input: <math display="inline"> (u,v) </math> a basis for the lattice <math display="inline"> L</math>. Assume that <math display="inline"> ||v|| \leq ||u|| </math>, otherwise swap them.
Output: A basis <math display="inline"> (u,v) </math> with <math display="inline"> ||u|| = \lambda_1(L), ||v|| = \lambda_2(L) </math>.

While <math display="inline"> ||v|| < ||u|| </math>:
<math display="inline"> q := \lfloor {\langle u, \frac{ v}{||v||^2} \rangle } \rceil </math> # Round to nearest integer
<math display="inline"> r := u - qv </math>
<math display="inline"> u := v </math>
<math display="inline"> v := r </math>

<!--- a picture explaining the geometric viewpoint would be great --->

See the section on Lagrange's algorithm in <ref name="Nguyen 2009 pp. 19–69">{{cite book | last=Nguyen | first=Phong Q. | title=The LLL Algorithm | chapter=Hermite’s Constant and Lattice Algorithms | series=Information Security and Cryptography | publisher=Springer Berlin Heidelberg | location=Berlin, Heidelberg | year=2009 | isbn=978-3-642-02294-4 | issn=1619-7100 | doi=10.1007/978-3-642-02295-1_2 | pages=19–69}}</ref> for further details.


==Applications==
==Applications==
Lattice reduction algorithms are used in a number of modern number theoretical applications, including in the discovery of a [[spigot algorithm]] for <math>\pi</math>. Although determining the shortest basis is possibly an NP-complete problem, algorithms such as the [[Lenstra–Lenstra–Lovász lattice basis reduction algorithm|LLL algorithm]] <ref>{{cite journal | author = [[A. K. Lenstra|Lenstra, A. K.]]; [[H. W. Lenstra, Jr.|Lenstra, H. W., Jr.]]; [[László Lovász|Lovász, L.]] | title = Factoring polynomials with rational coefficients | journal = [[Mathematische Annalen]] | volume = 261 | year = 1982 | issue = 4 | pages = 515–534 | hdl = 1887/3810 | doi = 10.1007/BF01457454 | mr = 0682664 }}</ref> can find a short (not necessarily shortest) basis in polynomial time with guaranteed worst-case performance. [[Lenstra–Lenstra–Lovász lattice basis reduction algorithm|LLL]] is widely used in the [[cryptanalysis]] of [[Public-key cryptography|public key]] cryptosystems.
Lattice reduction algorithms are used in a number of modern number theoretical applications, including in the discovery of a [[spigot algorithm]] for <math>\pi</math>. Although determining the shortest basis is possibly an NP-complete problem, algorithms such as the [[Lenstra–Lenstra–Lovász lattice basis reduction algorithm|LLL algorithm]]<ref>{{cite journal | author = Lenstra, A. K. | author-link = A. K. Lenstra | author2 = Lenstra, H. W. Jr. | author2-link = H. W. Lenstra Jr. | author3 = Lovász, L. | author3-link = László Lovász | title = Factoring polynomials with rational coefficients | journal = [[Mathematische Annalen]] | volume = 261 | year = 1982 | issue = 4 | pages = 515–534 | hdl = 1887/3810 | doi = 10.1007/BF01457454 | mr = 0682664 | citeseerx = 10.1.1.310.318 | s2cid = 5701340 }}</ref> can find a short (not necessarily shortest) basis in polynomial time with guaranteed worst-case performance. [[Lenstra–Lenstra–Lovász lattice basis reduction algorithm|LLL]] is widely used in the [[cryptanalysis]] of [[Public-key cryptography|public key]] cryptosystems.


When used to find integer relations, a typical input to the algorithm consists of an augmented <math>n</math> x <math>n</math> identity matrix with the entries in the last column consisting of the <math>n</math> elements (multiplied by a large positive constant <math>w</math> to penalize vectors that do not sum to zero) between which the relation is sought.
When used to find integer relations, a typical input to the algorithm consists of an augmented <math>n \times n</math> identity matrix with the entries in the last column consisting of the <math>n</math> elements (multiplied by a large positive constant <math>w</math> to penalize vectors that do not sum to zero) between which the relation is sought.


The [[LLL algorithm]] for computing a nearly-orthogonal basis was used to show that [[integer programming]] in any fixed dimension can be done in [[P (complexity)|polynomial time]].<ref>{{cite journal|
The [[LLL algorithm]] for computing a nearly-orthogonal basis was used to show that [[integer programming]] in any fixed dimension can be done in [[P (complexity)|polynomial time]].<ref>{{cite journal
doi = 10.1287/moor.8.4.538|
| doi=10.1287/moor.8.4.538
author = Lenstra, H.W.|
| last1=Lenstra, Jr. | first1=H. W. | authorlink1=Hendrik Lenstra
title = Integer programming with a fixed number of variables|
| title=Integer programming with a fixed number of variables
| journal=[[Mathematics of Operations Research]]
journal = Math. Oper. Res.|
year = 1983|
| date=1983
volume = 8|
| volume=8
| issue=4
pages = 538–548
| pages=538–548
}}
| citeseerx = 10.1.1.431.5444}}</ref>
</ref>


==Algorithms==
==Algorithms==
The following algorithms reduce lattice bases. They can be compared in terms of runtime and approximation to an optimal solution, always relative to the dimension of the given lattice. If there are public implementations of these algorithms this should also be noted here.
The following algorithms reduce lattice bases; several public implementations of these algorithms are also listed.


{|
{|
Line 42: Line 57:
! Year
! Year
! Algorithm
! Algorithm
! Name
! Implementation
! Implementation
|-
| 1773
| Lagrange/Gauss reduction for 2D lattices
|
|-
|-
| 1982
| 1982
| [[Lenstra–Lenstra–Lovász lattice basis reduction algorithm|LLL]]
| [[Lenstra–Lenstra–Lovász lattice basis reduction algorithm|Lenstra–Lenstra–Lovász]] reduction
| [[Number Theory Library|NTL]], [https://github.com/dstehle/fplll fplll]
| Lenstra Lenstra Lovász
| [[Number Theory Library|NTL]], [https://github.com/dstehle/fplll fplll (GitHub link)]
|-
|-
| 1987
| 1987
| Block [[Korkine–Zolotarev lattice basis reduction algorithm|Korkine–Zolotarev]]<ref>{{cite arXiv|last1=Hanrot|first1=Guillaume|last2=Stehlé|first2=Damien|title=Worst-Case Hermite-Korkine-Zolotarev Reduced Lattice Bases|date=2008|eprint=0801.3331|class=math.NT}}</ref>
| BKZ
| [[Number Theory Library|NTL]], [https://github.com/dstehle/fplll fplll]
| Block Korkine Zolotarev<ref>{{cite journal|last1=Hanrot|first1=Guillaume|last2=Stehlé|first2=Damien|title=Worst-Case Hermite-Korkine-Zolotarev Reduced Lattice Bases|journal=CoRR|date=2008|volume=abs/0801.3331|arxiv=0801.3331}}</ref>
| [[Number Theory Library|NTL]], [https://github.com/dstehle/fplll fplll (GitHub link)]
|-
|-
| 2002
| 1993
| Seysen Reduction<ref>{{cite journal |last1=Seysen |first1=Martin |title=Simultaneous reduction of a lattice basis and its reciprocal basis |journal=Combinatorica |date=September 1993 |volume=13 |issue=3 |pages=363–376 |doi=10.1007/BF01202355 |s2cid=206791637 }}</ref>
| RSR
|
| Random Sampling Reduction
|
|-
| 2002
| PDR
| Primal Dual Reduction
|
|}
|}


==References==
==References==
{{Reflist}}
<references/>


[[Category:Theory of cryptography]]
[[Category:Theory of cryptography]]
Line 73: Line 83:
[[Category:Lattice points]]
[[Category:Lattice points]]
[[Category:Linear algebra]]
[[Category:Linear algebra]]
[[Category:Cryptography]]
[[Category:Lattice-based cryptography]]
[[Category:Lattice-based cryptography]]
[[Category:Post-quantum cryptography]]
[[Category:Post-quantum cryptography]]

Latest revision as of 23:52, 22 January 2024

Lattice reduction in two dimensions: the black vectors are the given basis for the lattice (represented by blue dots), the red vectors are the reduced basis

In mathematics, the goal of lattice basis reduction is to find a basis with short, nearly orthogonal vectors when given an integer lattice basis as input. This is realized using different algorithms, whose running time is usually at least exponential in the dimension of the lattice.

Nearly orthogonal[edit]

One measure of nearly orthogonal is the orthogonality defect. This compares the product of the lengths of the basis vectors with the volume of the parallelepiped they define. For perfectly orthogonal basis vectors, these quantities would be the same.

Any particular basis of vectors may be represented by a matrix , whose columns are the basis vectors . In the fully dimensional case where the number of basis vectors is equal to the dimension of the space they occupy, this matrix is square, and the volume of the fundamental parallelepiped is simply the absolute value of the determinant of this matrix . If the number of vectors is less than the dimension of the underlying space, then volume is . For a given lattice , this volume is the same (up to sign) for any basis, and hence is referred to as the determinant of the lattice or lattice constant .

The orthogonality defect is the product of the basis vector lengths divided by the parallelepiped volume;

From the geometric definition it may be appreciated that with equality if and only if the basis is orthogonal.

If the lattice reduction problem is defined as finding the basis with the smallest possible defect, then the problem is NP-hard [citation needed]. However, there exist polynomial time algorithms to find a basis with defect where c is some constant depending only on the number of basis vectors and the dimension of the underlying space (if different)[citation needed]. This is a good enough solution in many practical applications[citation needed].

In two dimensions[edit]

For a basis consisting of just two vectors, there is a simple and efficient method of reduction closely analogous to the Euclidean algorithm for the greatest common divisor of two integers. As with the Euclidean algorithm, the method is iterative; at each step the larger of the two vectors is reduced by adding or subtracting an integer multiple of the smaller vector.

The pseudocode of the algorithm, often known as Lagrange's algorithm or the Lagrange-Gauss algorithm, is as follows:

    Input:  a basis for the lattice . Assume that , otherwise swap them.
    Output: A basis  with .
    While :
          # Round to nearest integer
         
         
         


See the section on Lagrange's algorithm in [1] for further details.

Applications[edit]

Lattice reduction algorithms are used in a number of modern number theoretical applications, including in the discovery of a spigot algorithm for . Although determining the shortest basis is possibly an NP-complete problem, algorithms such as the LLL algorithm[2] can find a short (not necessarily shortest) basis in polynomial time with guaranteed worst-case performance. LLL is widely used in the cryptanalysis of public key cryptosystems.

When used to find integer relations, a typical input to the algorithm consists of an augmented identity matrix with the entries in the last column consisting of the elements (multiplied by a large positive constant to penalize vectors that do not sum to zero) between which the relation is sought.

The LLL algorithm for computing a nearly-orthogonal basis was used to show that integer programming in any fixed dimension can be done in polynomial time.[3]

Algorithms[edit]

The following algorithms reduce lattice bases; several public implementations of these algorithms are also listed.

Year Algorithm Implementation
1773 Lagrange/Gauss reduction for 2D lattices
1982 Lenstra–Lenstra–Lovász reduction NTL, fplll
1987 Block Korkine–Zolotarev[4] NTL, fplll
1993 Seysen Reduction[5]

References[edit]

  1. ^ Nguyen, Phong Q. (2009). "Hermite's Constant and Lattice Algorithms". The LLL Algorithm. Information Security and Cryptography. Berlin, Heidelberg: Springer Berlin Heidelberg. pp. 19–69. doi:10.1007/978-3-642-02295-1_2. ISBN 978-3-642-02294-4. ISSN 1619-7100.
  2. ^ Lenstra, A. K.; Lenstra, H. W. Jr.; Lovász, L. (1982). "Factoring polynomials with rational coefficients". Mathematische Annalen. 261 (4): 515–534. CiteSeerX 10.1.1.310.318. doi:10.1007/BF01457454. hdl:1887/3810. MR 0682664. S2CID 5701340.
  3. ^ Lenstra, Jr., H. W. (1983). "Integer programming with a fixed number of variables". Mathematics of Operations Research. 8 (4): 538–548. CiteSeerX 10.1.1.431.5444. doi:10.1287/moor.8.4.538.
  4. ^ Hanrot, Guillaume; Stehlé, Damien (2008). "Worst-Case Hermite-Korkine-Zolotarev Reduced Lattice Bases". arXiv:0801.3331 [math.NT].
  5. ^ Seysen, Martin (September 1993). "Simultaneous reduction of a lattice basis and its reciprocal basis". Combinatorica. 13 (3): 363–376. doi:10.1007/BF01202355. S2CID 206791637.