# LLL 格基约化

**LLL 格基约化**是一种多项式时间算法，由阿延·K·伦斯特拉（Arjen K. Lenstra）、小亨德里克·W·伦斯特拉（Hendrik W. Lenstra, Jr.）和拉斯洛·洛瓦兹（László Lovász）于1982年发表，能将整数格的任意一组基变换为具有可证明保证的短且近乎正交的向量基<sup>[1](https://eudml.org/doc/182903)</sup><sup> • </sup><sup>[2](https://people.cs.uchicago.edu/~laci/reu03/notes7/)</sup>。该算法出现在《Mathematische Annalen》第261卷515–534页的论文《有理系数多项式的因式分解》中，作为有理数域上多项式分解的首个多项式时间算法的核心<sup>[1](https://eudml.org/doc/182903)</sup>。该算法并不寻找格中的最短向量；它在维数和输入规模的多项式时间内，找到一组向量足够短以致有用的基<sup>[2](https://people.cs.uchicago.edu/~laci/reu03/notes7/)</sup>。

| 关键事实 | 详情 |
|---|---|
| 起源 | 伦斯特拉、伦斯特拉和洛瓦兹，《Mathematische Annalen》261 (1982)，515–534，作为 ℚ 上多项式多项式时间分解算法的一部分<sup>[1](https://eudml.org/doc/182903)</sup> |
| 输出保证 | LLL约化基满足尺寸约化 \( |\mu_{i,j}| \le 1/2 \) 以及参数为 δ 的洛瓦兹条件；原论文使用 δ = 3/4<sup>[3](https://web.eecs.umich.edu/~cpeikert/lic13/lec03.pdf)</sup> |
| 它不做什么 | 它是多项式时间的，但不寻找格中的最短向量<sup>[2](https://people.cs.uchicago.edu/~laci/reu03/notes7/)</sup> |
| 参数权衡 | δ ∈ (1/4, 1)；越接近1的值给出约化更好的输出，但需要更多迭代<sup>[4](https://www.lattices.io/algorithms/lll)</sup> |
| 二维祖先 | 高斯的格基约化算法能在二维中找到最短非零向量，它作为子算法在LLL内部使用<sup>[5](https://umu.diva-portal.org/smash/get/diva2%3A1362877/FULLTEXT01.pdf)</sup> |
| 标准实现 | fplll 库执行带浮点正交化的LLL，默认 δ = 0.99、η = 0.51<sup>[6](https://github.com/fplll/fplll/blob/master/README.md?plain=1)</sup> |
| 密码分析角色 | LLL 是 Boneh 和 Durfee 攻击的基础，该攻击表明当私钥指数满足 d < N^{0.292} 时 RSA 可被攻破<sup>0.292</sup><sup> • </sup><sup>[7](https://www.sciencedirect.com/science/article/abs/pii/S009630030400791X)</sup> |

## LLL约化基的定义

格是一组基向量的所有整数线性组合构成的集合，而同一个格有许多不同的基。约化意味着将给定的基替换为向量短且近乎正交的基。当以下两个条件成立时，基 **B** 被称为LLL约化基<sup>[3](https://web.eecs.umich.edu/~cpeikert/lic13/lec03.pdf)</sup>：

1. **尺寸约化。** 对每个 \( i < j \)，Gram–Schmidt 系数满足 \( |\mu_{i,j}| \le 1/2 \)。Gram–Schmidt 向量 \( \tilde{\mathbf b}_i \) 是正交的，但它们本身并不位于格中；它们生活在实张成空间中<sup>[3](https://web.eecs.umich.edu/~cpeikert/lic13/lec03.pdf)</sup><sup> • </sup><sup>[4](https://www.lattices.io/algorithms/lll)</sup>。
2. **洛瓦兹条件。** 对每个 \( 1 \le i < n \)，\[ \frac{3}{4}\|\tilde{\mathbf b}_i\|^2 \le \|\mu_{i,i+1}\tilde{\mathbf b}_i + \tilde{\mathbf b}_{i+1}\|^2. \] 该条件对基进行排序：它防止相邻的 Gram–Schmidt 范数下降过快<sup>[3](https://web.eecs.umich.edu/~cpeikert/lic13/lec03.pdf)</sup><sup> • </sup><sup>[4](https://www.lattices.io/algorithms/lll)</sup>。

该定义对顺序敏感：相同的基向量以不同方式排列可能不构成洛瓦兹约化基<sup>[2](https://people.cs.uchicago.edu/~laci/reu03/notes7/)</sup>。在一般形式中，常数 3/4 被替换为参数 δ，基被称为 δ-LLL约化基；δ 起到对洛瓦兹条件的缩放作用<sup>[8](https://www.colby.edu/wp-content/uploads/2019/05/2019-Kane-Thesis.pdf)</sup>。更大的 δ 以更多计算为代价产生更短的输出向量<sup>[4](https://www.lattices.io/algorithms/lll)</sup>。

## 算法工作原理

给定 \( \mathbb{Z}^{n \times n} \) 中的整数输入基 **B**（不失一般性的假设），算法计算 Gram–Schmidt 正交化 \( \tilde{\mathbf B} \)，然后应用尺寸约化步骤，在不改变所生成格或 Gram–Schmidt 向量的情况下强制满足条件1。每当相邻对的洛瓦兹条件不成立时，算法交换这两个向量并回溯以继续过程<sup>[3](https://web.eecs.umich.edu/~cpeikert/lic13/lec03.pdf)</sup>。

二维情形由高斯的格基约化算法处理，这是最基本的约化方法，能高效找到二维格的最短非零向量；LLL 将其作为子算法使用<sup>[5](https://umu.diva-portal.org/smash/get/diva2%3A1362877/FULLTEXT01.pdf)</sup>。洛瓦兹条件保证度量 Gram–Schmidt 范数乘积的势函数在每次交换时下降固定因子，这正是将运行时间限制为多项式的原因<sup>[3](https://web.eecs.umich.edu/~cpeikert/lic13/lec03.pdf)</sup>。

## 起源与多项式分解应用

该算法在1982年论文《有理系数多项式的因式分解》中由数学中心（Mathematisch Centrum）的阿延·K·伦斯特拉、小亨德里克·W·伦斯特拉和阿尔弗雷德·雷尼研究所（Alfréd Rényi Institute）的拉斯洛·洛瓦兹提出<sup>[1](https://eudml.org/doc/182903)</sup><sup> • </sup><sup>[9](https://www.researchgate.net/publication/50863306_Factoring_Polynomials_with_Rational_Coefficients)</sup>。该论文提出一种多项式时间算法，给定有理系数的一元非零多项式，找到其不可约因子的分解，这等价于在 \( \mathbb{Z}[X] \) 中分解本原多项式<sup>[9](https://www.researchgate.net/publication/50863306_Factoring_Polynomials_with_Rational_Coefficients)</sup>。格步骤找到向量间的近似线性依赖关系，用格术语表达，这一构造成为LLL最早发表的应用<sup>[10](https://library.slmath.org/books/Book44/files/06hwl.pdf)</sup>。

伦斯特拉及其同事注意到该算法也可用于通过确定整数关系来获得一元多项式的因子，这一应用后来成为其主要用途之一，尽管在原论文中并未强调<sup>[11](https://mathworld.wolfram.com/LLLAlgorithm.html)</sup>。

## 输出质量与浮点实现

所有有竞争力的LLL实现都依赖浮点运算，其中 Gram–Schmidt 正交化所需的有理运算被浮点计算替代；这些变体现今是已知最快的<sup>[12](https://arxiv.org/abs/1905.11743)</sup>。1988年，当时在法兰克福大学的克劳斯·P·施诺尔（Claus P. Schnorr）描述了首个可证明的LLL浮点变体，随后出现了一系列启发式和可证明变体<sup>[13](https://www.ionica.nl/wp-content/uploads/2019/04/the-LLL-Algorithms.pdf)</sup>。在浮点运算中使用 Householder 正交化的LLL算法非常高效且精度很高<sup>[14](https://www.researchgate.net/publication/226176477_Progress_on_LLL_and_Lattice_Reduction)</sup>。

参考实现是开源库 fplll，其名称反映了LLL在代码中的核心地位。它提供多种具有不同速度/保证比率的浮点LLL变体，外加一个自动选择最佳变体序列的包装器。在默认选项（δ = 0.99、η = 0.51）下，包装器或已证明版本保证输出基为 (0.98, 0.52)-LLL约化基<sup>[6](https://github.com/fplll/fplll/blob/master/README.md?plain=1)</sup>。fplll 还实现了 BKZ 约化、滑动约化和最短向量枚举，并通过 fpylll 接口暴露给 Python，且包含在 Sage 中<sup>[6](https://github.com/fplll/fplll/blob/master/README.md?plain=1)</sup>。Wolfram 语言的 `LatticeReduce` 命令也实现了LLL，要求有理输入<sup>[11](https://mathworld.wolfram.com/LLLAlgorithm.html)</sup>。

当需要对输出进行数学保证时，例如证明给定数之间不存在小的整数线性关系，经过认证的变体就很重要。分别来自索邦大学和巴黎大学的埃斯皮托（Espitau）与茹（Joux）开发了一种自适应精度的广义LLL，用区间算术替代浮点运算以认证算法的行为，并应用于数域中理想格的约化<sup>[12](https://arxiv.org/abs/1905.11743)</sup>。

## 应用

**多项式分解与数论。** 除了最初的分解结果之外，基于LLL的格基约化是计算数论中的基本工具<sup>[12](https://arxiv.org/abs/1905.11743)</sup>。van Hoeij 算法将整数多项式分解的组合部分转化为用LLL在多项式时间内求解的背包等价问题，并在许多计算机代数系统中实现<sup>[15](https://arxiv.org/abs/2410.15880)</sup>。

**整数关系。** 实数 \( x_1, \ldots, x_n \) 的整数关系是一个不全为零的整数向量 \( a_k \)，满足 \( \sum_k a_k x_k = 0 \)。LLL 从足够精确的数值数据中找到此类关系，而后来的 PSLQ 算法在此任务上可以显著更快<sup>[11](https://mathworld.wolfram.com/LLLAlgorithm.html)</sup>。在物理学中，PSLQ 和 LLL 已将费曼积分的数值计算转化为对多重多对数和模形式周期的精确归约<sup>[16](https://arxiv.org/abs/2103.06345)</sup>。

**密码分析。** 滑铁卢大学的密码学家阿尔弗雷德·梅内泽斯（Alfred Menezes）将LLL描述为密码分析中最强大、最通用的工具之一<sup>[17](https://cryptography101.ca/lattice-basis-reduction/)</sup>。Boneh 和 Durfee 2000年发表在《IEEE Transactions on Information Theory》上的结果表明，当 RSA 私钥指数满足 \( d < N^{0.292} \) 时，可使用LLL攻破该系统，后续工作将此类格攻击扩展到更大的私钥指数<sup>[7](https://www.sciencedirect.com/science/article/abs/pii/S009630030400791X)</sup>。格基约化还通过约化底层子集和格攻破了背包型公钥系统<sup>[18](https://arxiv.org/abs/1210.7417)</sup>。在构造性方面，格问题为可证明安全的密码函数提供最坏情况困难性假设，这一方向由加州大学圣地亚哥分校的达尼埃莱·米恰乔（Daniele Micciancio）在《The LLL Algorithm: Survey and Applications》一书中综述<sup>[19](https://cseweb.ucsd.edu/~daniele/papers/LLL25.html)</sup>。

## 实际行为

LLL的实际行为常被描述为神秘的：关于其在增长维数中平均行为的许多问题仍未解决，但实验显示了输出基的一般形态、某些输入族的可预测运行时间，以及从业者用来在实现变体之间进行选择的通用数值行为<sup>[13](https://www.ionica.nl/wp-content/uploads/2019/04/the-LLL-Algorithms.pdf)</sup>。实际约化的维数范围从 Coppersmith 方法中常见的40至100维，到 NTRU 和 GGH 挑战中的数百维，而计算群论和多项式分解中现在可约化非常大维数的格<sup>[13](https://www.ionica.nl/wp-content/uploads/2019/04/the-LLL-Algorithms.pdf)</sup>。

## References

1. [Lenstra, H.W. jr., Lenstra, A.K., and Lovász, L. "Factoring Polynomials with Rational Coefficients." Mathematische Annalen 261 (1982): 515–534. EUDML.](https://eudml.org/doc/182903)
2. [Lovász lattice reduction, REU 2003 lecture notes, University of Chicago.](https://people.cs.uchicago.edu/~laci/reu03/notes7/)
3. [Peikert, C. (instructor), Wang, Y. (scribe). "LLL, Coppersmith," Lattices in Cryptography, Georgia Tech, Fall 2013, Lecture 3.](https://web.eecs.umich.edu/~cpeikert/lic13/lec03.pdf)
4. ["LLL Algorithm: How It Works, with Python Code," Lattices.io.](https://www.lattices.io/algorithms/lll)
5. ["Lattice Reduction," DiVA portal thesis excerpt, Umeå University.](https://umu.diva-portal.org/smash/get/diva2%3A1362877/FULLTEXT01.pdf)
6. [The FPLLL development team. fplll README, Version 5.5.0. GitHub.](https://github.com/fplll/fplll/blob/master/README.md?plain=1)
7. ["Cryptanalysis of large RSA exponent by using the LLL algorithm," Applied Mathematics and Computation 169 (2005): 516–525. ScienceDirect.](https://www.sciencedirect.com/science/article/abs/pii/S009630030400791X)
8. [Kane, "Basis Reduction in Lattice Cryptography," Colby College thesis, 2019.](https://www.colby.edu/wp-content/uploads/2019/05/2019-Kane-Thesis.pdf)
9. ["Factoring Polynomials with Rational Coefficients," ResearchGate (December 1982, Mathematische Annalen 261(4)).](https://www.researchgate.net/publication/50863306_Factoring_Polynomials_with_Rational_Coefficients)
10. ["Algorithmic Number Theory," MSRI Publications, excerpt on the earliest published application of LLL.](https://library.slmath.org/books/Book44/files/06hwl.pdf)
11. ["LLL Algorithm," Wolfram MathWorld.](https://mathworld.wolfram.com/LLLAlgorithm.html)
12. [Espitau, T. and Joux, A. "Certified lattice reduction," arXiv:1905.11743 (2019).](https://arxiv.org/abs/1905.11743)
13. [Stehlé, D. "Floating-Point LLL: Theoretical and Practical Aspects," in The LLL Algorithm (Springer, 2010).](https://www.ionica.nl/wp-content/uploads/2019/04/the-LLL-Algorithms.pdf)
14. ["Progress on LLL and Lattice Reduction," ResearchGate.](https://www.researchgate.net/publication/226176477_Progress_on_LLL_and_Lattice_Reduction)
15. ["Integer Polynomial Factorization by Recombination of Real Factors," arXiv:2410.15880 (2024).](https://arxiv.org/abs/2410.15880)
16. [Acres, K. and Broadhurst, D. "Empirical determinations of Feynman integrals using integer relation algorithms," arXiv:2103.06345 (2021).](https://arxiv.org/abs/2103.06345)
17. [Menezes, A. "Lattice Basis Reduction – Cryptography 101."](https://cryptography101.ca/lattice-basis-reduction/)
18. ["Cryptanalysis of a Public-key Cryptosystem Using Lattice Basis Reduction Algorithm," arXiv:1210.7417 (2012).](https://arxiv.org/abs/1210.7417)
19. [Micciancio, D. "Cryptographic functions from worst-case complexity assumptions," in The LLL Algorithm: Survey and Applications, Springer, 2009.](https://cseweb.ucsd.edu/~daniele/papers/LLL25.html)

---
*Initially written Oct 15, 2026 · Edited: Oct 25, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Computational and probabilistic number theory › Integer-relation and lattice algorithms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/lll-lattice-reduction

English original: https://www.edgepedia.org/lll-lattice-reduction
