# Curve25519

**Curve25519** 是由丹尼尔·J·伯恩斯坦（Daniel J. Bernstein）在 p = 2^255 − 19 的素域上定义的一条椭圆曲线，旨在以约 128 位安全级别实现快速、常数时间的 Diffie–Hellman 密钥协商<sup>[1](https://cr.yp.to/ecdh/curve25519-20051115.pdf)</sup><sup> • </sup><sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup>。这一家族中的名称各有分工：Curve25519 是曲线本身，X25519 是其上的 Diffie–Hellman 函数，Ed25519 则是定义在双有理等价的扭曲爱德华兹曲线 edwards25519 上的签名方案<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup>。X25519 是 [TLS 1.3](https://www.edgepedia.org/zh/tls-1-3) 中受到广泛支持的密钥交换算法，为互联网上很大一部分 HTTPS 流量提供安全保障<sup>[3](https://www.cl.cam.ac.uk/teaching/2122/Crypto/curve25519.pdf)</sup>。

| 关键事实 | 详情 |
|---|---|
| 曲线方程 | 蒙哥马利曲线 v^2 = u^3 + 486662·u^2 + u，定义在 F_p 上，p = 2^255 − 19，余因子 8，基点 u = 9<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup> |
| 素数阶子群阶 | 2^252 + 0x14def9dea2f79cd65812631a5cf5d3ed<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup> |
| 安全级别 | 略低于标准的 128 位级别，设计者认为这一取舍可以接受<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup> |
| 密钥大小 | 公钥和共享密钥均为 32 字节，而未压缩的 P-256 密钥份额为 65 字节<sup>[4](https://www.mail-archive.com/tls@ietf.org/msg17787.html)</sup> |
| 速度（AMD Zen 4，eBACS） | 生成密钥对需 101,289 个周期，计算共享密钥需 109,491 个周期；NIST P-256 则分别为 202,616 和 535,274 个周期<sup>[4](https://www.mail-archive.com/tls@ietf.org/msg17787.html)</sup> |
| 标准 | RFC 7748（X25519/X448，2016 年 1 月）、RFC 8032（Ed25519）、RFC 8446（TLS 1.3，2018 年）<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup><sup> • </sup><sup>[5](https://www.usenix.org/system/files/usenixsecurity24-zhang-jipeng.pdf)</sup> |
| 部署份额 | 2024 年 9 月的扫描显示，在观测到的 TLS 1.3 握手中占 69%，在 SSH curve25519-sha256 密钥交换中占 78%<sup>[6](https://troll.iis.sinica.edu.tw/ecc24/slides/4-05-ecc.pdf)</sup> |

## 数学定义与参数

RFC 7748 将 curve25519 定义为蒙哥马利曲线

\[ v^2 = u^3 + 486662 \cdot u^2 + u \]

定义在 p = 2^255 − 19 的素域上，余因子为 8，素数阶子群的阶为 2^252 + 0x14def9dea2f79cd65812631a5cf5d3ed，基点 u = 9<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup>。推荐使用该素数，是因为它能在多种架构上以约 128 位安全级别实现良好性能<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup>。

其安全级别略低于标准的 128 位，RFC 明确说明了这一取舍：若严格坚持二的幂次的安全级别，就必须在设计中的其他地方做出妥协<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup>。该曲线与扭曲爱德华兹曲线 −x^2 + y^2 = 1 + d·x^2·y^2 双有理等价，后者称为 edwards25519，正是 Ed25519 签名所运作的曲线<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup>。

## X25519 的工作原理

Curve25519 函数后来被标准化为 X25519，它是曲线上受限在 F_p 上的 x 坐标标量乘法：给定一个标量（私钥）和另一方的 u 坐标，它计算标量倍点的 u 坐标，结果即作为共享密钥<sup>[1](https://cr.yp.to/ecdh/curve25519-20051115.pdf)</sup>。密钥为 32 字节<sup>[4](https://www.mail-archive.com/tls@ietf.org/msg17787.html)</sup>。

有两个设计特性使该函数在实际中与众不同。第一，它专为常数时间执行而设计，不含依赖数据的分支，从而抵御时序侧信道攻击<sup>[7](https://lists.mindrot.org/pipermail/openssh-unix-dev/2013-September/031659.html)</sup>。第二，它提供无额外开销的密钥验证：由于该函数作用于曲线及其扭曲线上的 x 坐标，任何 32 字节字符串都是合法输入，计算过程不会通过拒绝点泄露信息<sup>[1](https://cr.yp.to/ecdh/curve25519-20051115.pdf)</sup>。

## 安全属性与注意事项

**余因子与小子群攻击。** 由于 curve25519 的余因子为 8，一个小阶输入点会消除另一方的私钥所带来的全部贡献。RFC 7748 规定，可以通过检查输出是否全为零来检测这种情况<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup>。伯恩斯坦的回顾文章将小子群攻击、无效曲线攻击和多用户批量攻击列为实现者已知的关切<sup>[8](https://cr.yp.to/talks/2016.03.09/slides-djb-20160309-a4.pdf)</sup>。

**扭曲线安全。** SafeCurves 项目依据涵盖阶梯算法、扭曲线、完备性和不可区分性的标准来评估曲线；Curve25519 被归类为安全，满足 SafeCurves 的全部标准<sup>[9](https://eprint.iacr.org/2024/1265.pdf)</sup>。

这些属性仍然依赖于正确的实现。在 Rust SSH 库 russh 0.63.0 之前的版本中，混合 ML-KEM 768 与 X25519 密钥交换接受全零的 32 字节对端 X25519 公钥，迫使 X25519 对组合共享密钥的贡献归零；恶意的 SSH 对端由此可使组合密钥仅依赖于 ML-KEM，破坏了混合交换所意图的兜底保护。该问题在 0.63.0 版本中修复<sup>[10](https://notcve.org/cve/CVE-2026-102824)</sup>。

## 数据一览

2006 年的原始实现每次 Diffie–Hellman 运算达到 832457 个 [Pentium III](https://www.edgepedia.org/zh/pentium-iii) 周期，在同一推测安全级别下比其他作者的结果快一倍以上，且附带无额外开销的密钥压缩、无额外开销的密钥验证和时序攻击防护<sup>[1](https://cr.yp.to/ecdh/curve25519-20051115.pdf)</sup>。

2023 年在 AMD Zen 4 上的现代 eBACS/supercop 测量显示，Curve25519 生成密钥对需 101,289 个周期，计算共享密钥需 109,491 个周期，而 NIST P-256 分别为 202,616 和 535,274 个周期<sup>[4](https://www.mail-archive.com/tls@ietf.org/msg17787.html)</sup>。在 i7-10850H 上运行 OpenSSL 3.1.1 时，x25519 达到每秒 35,062.2 次共享密钥运算，P-256 则为每秒 22,741.1 次<sup>[4](https://www.mail-archive.com/tls@ietf.org/msg17787.html)</sup>。

优化的向量化实现更进一步。USENIX Security 2024 的一项研究报告称，AVX-512IFMA 的 X25519 KeyGen 为 60,479 个周期，而 OpenSSL 为 90,809 个周期；X25519-Derive 在 OpenSSL 中为 90,849 个周期，AVX-512F 下为 61,867 个周期，AVX2 下为 64,832 个周期<sup>[5](https://www.usenix.org/system/files/usenixsecurity24-zhang-jipeng.pdf)</sup>。在 TLS 1.3 握手测试中，优化配置达到每秒 1,707 个连接，而标准 X25519 为 1,366 个，P-256 为 1,260 个<sup>[5](https://www.usenix.org/system/files/usenixsecurity24-zhang-jipeng.pdf)</sup>。

## 与其他曲线的比较

RFC 8031 将 Curve25519 置于约 128 位安全级别，与 NIST P-256 群相当，Curve448 则约为 224 位<sup>[11](https://datatracker.ietf.org/doc/html/rfc8031)</sup>。在速度方面，brainpoolP256 因其伪随机素数而显著慢于 NIST P-256，而 P-256 本身又慢于 Curve25519<sup>[11](https://datatracker.ietf.org/doc/html/rfc8031)</sup>。

最鲜明的对比在于参数的来源。NIST 曲线据称是以可验证为随机的方式选取的，但其生成背后的种子从未得到解释；相比之下，Curve25519 和 Curve448 的选取过程完全公开、记录在案，且严格到足以允许独立验证——事实上这种验证已经发生。<sup>[11](https://datatracker.ietf.org/doc/html/rfc8031)</sup> SafeCurves 因此将 Curve25519 归类为安全，而 P-256 则出现在未获此分类的曲线之列<sup>[9](https://eprint.iacr.org/2024/1265.pdf)</sup>。

2013 年斯诺登事件曝光后，这一区别变得至关重要，该事件引发了对软件、硬件组件和已发布标准中后门的担忧；Curve25519 因其速度、常数时间运行特性以及没有含糊不清的硬编码常量而被提议用于 SSH<sup>[7](https://lists.mindrot.org/pipermail/openssh-unix-dev/2013-September/031659.html)</sup>。尤其是在 NSA 故意在 Dual_EC_DRBG 函数中植入弱点的消息披露后，人们对 NIST 批准的算法普遍产生怀疑，Curve25519 的受欢迎程度随之大增<sup>[12](https://lwn.net/Articles/590684/)</sup>。

## 标准化与部署

2015 年 10 月，IRTF 加密论坛研究组确定了用于 Diffie–Hellman 的 X25519 和 X448，以及用于签名的 Ed25519 和 Ed448<sup>[8](https://cr.yp.to/talks/2016.03.09/slides-djb-20160309-a4.pdf)</sup>。2016 年 1 月发布的 RFC 7748 规定了 128 位安全级别的 X25519；RFC 8032 规定了 Ed25519；RFC 8446 于 2018 年将两者纳入 TLS 1.3<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup><sup> • </sup><sup>[5](https://www.usenix.org/system/files/usenixsecurity24-zhang-jipeng.pdf)</sup>。

安全关键工具中的部署紧随其后。据设计者所述，苹果于 2012 年部署了 Curve25519，Signal 于 2013 年，OpenSSH 于 2014 年<sup>[8](https://cr.yp.to/talks/2016.03.09/slides-djb-20160309-a4.pdf)</sup>。OpenSSH 6.5（2014 年 1 月）加入了 Curve25519 ECDH 密钥交换，并在客户端和服务器均支持时将其设为默认，同时新增 Ed25519 作为公钥类型<sup>[13](https://lists.mindrot.org/pipermail/openssh-unix-dev/2014-January/032152.html)</sup>。

2024 年的遥测数据展示了该曲线的统治地位。在 UCSD 于 2024 年 9 月观测到的 TLS 1.3 握手中，x25519 占 8700 万次握手（69%），NIST P-384 占 12%，后量子草案组 X25519Kyber768Draft00 占 10%，NIST P-256 仅占 2%<sup>[6](https://troll.iis.sinica.edu.tw/ecc24/slides/4-05-ecc.pdf)</sup>。Mozilla Firefox 2024 年 6 月的遥测显示，X25519 占 ECDHE 密钥交换曲线的 84.50%，P-256 占 14.03%，P-384 占 0.93%，P-521 占 0.53%<sup>[14](https://www.mail-archive.com/tls@ietf.org/msg17688.html)</sup>。在同一 2024 年 9 月数据集观测到的 SSH 密钥交换中，curve25519-sha256 占 78%，curve25519-sha256@libssh.org 占 16%，而后量子混合方案 sntrup761x25519-sha512@openssh.com 达到 2.8%<sup>[6](https://troll.iis.sinica.edu.tw/ecc24/slides/4-05-ecc.pdf)</sup>。在同一数据集中较旧的 TLS 1.2 时代握手里，NIST P-256 以 42% 领先，P-384 占 38%，x25519 则占 19%<sup>[6](https://troll.iis.sinica.edu.tw/ecc24/slides/4-05-ecc.pdf)</sup>。

## 近期进展

主要进展是后量子混合迁移，即将 X25519 与基于格的 KEM 结合，使得即使其中一个组件日后被攻破，连接仍能受到保护。Chrome 于 2023 年 11 月将草案组 X25519Kyber768Draft00（X25519 与第三轮 Kyber-768 的混合）提升至桌面流量的 10%，并于 2024 年初默认启用<sup>[15](https://blog.crawlex.net/blog/post-quantum-tls-ml-kem/)</sup>。2024 年 8 月 [FIPS 203](https://www.edgepedia.org/zh/fips-203) 以非位兼容的改动落地后，部署从 Kyber 草案代码点迁移到标准化的 X25519MLKEM768，代码点为 0x11EC；Chrome 于 2024 年底、大约 Chrome 131 时完成了这一切换<sup>[15](https://blog.crawlex.net/blog/post-quantum-tls-ml-kem/)</sup>。Firefox 132 于 2024 年 10/11 月默认启用 X25519MLKEM768，OpenSSL 3.5 于 2025 年 4 月默认启用，苹果于 2025 年 10 月在 iOS、iPadOS 和 macOS 26 上全面默认推出<sup>[15](https://blog.crawlex.net/blog/post-quantum-tls-ml-kem/)</sup>。

一份 IETF 草案更新了 TLS Supported Groups 注册表，将 X25519MLKEM768（代码点 4588）、SecP256r1MLKEM768 和 SecP384r1MLKEM1024 标记为“推荐”，其动机是“先存储、后解密”的威胁<sup>[16](https://www.ietf.org/archive/id/draft-westerbaan-tls-keyshare-recommendations-02.html)</sup>。

迁移也在新形态下暴露了熟悉的实现陷阱。上文描述的 russh 零点验证缺陷表明，即使 X25519 只是混合交换的一个组件，RFC 7748 规定的全零输出检查仍然必要<sup>[2](https://datatracker.ietf.org/doc/html/rfc7748)</sup><sup> • </sup><sup>[10](https://notcve.org/cve/CVE-2026-102824)</sup>。

## References

1. [Daniel J. Bernstein (2006). Curve25519: new Diffie-Hellman speed records. PKC 2006.](https://cr.yp.to/ecdh/curve25519-20051115.pdf)
2. [RFC 7748: Elliptic Curves for Security (January 2016), IETF.](https://datatracker.ietf.org/doc/html/rfc7748)
3. [Implementing Curve25519/X25519: A Tutorial on Elliptic Curve Cryptography, University of Cambridge.](https://www.cl.cam.ac.uk/teaching/2122/Crypto/curve25519.pdf)
4. [TLS mailing list: Curve-popularity data? (eBACS/supercop and OpenSSL benchmarks).](https://www.mail-archive.com/tls@ietf.org/msg17787.html)
5. [Jipeng Zhang et al. (2024). ENG25519: Faster TLS 1.3 handshake using optimized X25519 and Ed25519. USENIX Security 2024.](https://www.usenix.org/system/files/usenixsecurity24-zhang-jipeng.pdf)
6. [The State of the Art of ECC in Real-World Protocols, ECC 2024 (UCSD passive scans).](https://troll.iis.sinica.edu.tw/ecc24/slides/4-05-ecc.pdf)
7. [curve25519-sha256 key exchange proposal, OpenSSH list (September 2013).](https://lists.mindrot.org/pipermail/openssh-unix-dev/2013-September/031659.html)
8. [Daniel J. Bernstein (2016). The first 10 years of Curve25519.](https://cr.yp.to/talks/2016.03.09/slides-djb-20160309-a4.pdf)
9. [Safe curves for elliptic-curve cryptography (SafeCurves), IACR eprint 2024/1265.](https://eprint.iacr.org/2024/1265.pdf)
10. [CVE-2026-102824: Missing X25519 zero-point validation in hybrid ML-KEM key exchange (russh).](https://notcve.org/cve/CVE-2026-102824)
11. [RFC 8031: Curve25519 and Curve448 for IKEv2 Key Agreement, IETF.](https://datatracker.ietf.org/doc/html/rfc8031)
12. [Security: OpenSSH 6.5 and Curve25519, LWN.net (2014).](https://lwn.net/Articles/590684/)
13. [OpenSSH 6.5 release announcement (January 2014).](https://lists.mindrot.org/pipermail/openssh-unix-dev/2014-January/032152.html)
14. [TLS mailing list: Curve-popularity data? (Mozilla Firefox telemetry, June 2024).](https://www.mail-archive.com/tls@ietf.org/msg17688.html)
15. [Post-quantum TLS: ML-KEM, X25519MLKEM768, and the hybrid handshake.](https://blog.crawlex.net/blog/post-quantum-tls-ml-kem/)
16. [draft-westerbaan-tls-keyshare-recommendations-02, IETF Internet-Draft.](https://www.ietf.org/archive/id/draft-westerbaan-tls-keyshare-recommendations-02.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Security governance and internet policy › Cryptographic protocols › Authenticated key exchange and handshake protocols

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/curve25519

English original: https://www.edgepedia.org/curve25519
