Curve25519 Diffie-Hellman key exchange using Montgomery curve arithmetic for ECDH. Provides 128-bit security with high performance and side-channel resistance. Used extensively in modern protocols like TLS 1.3, SSH, and WireGuard.
| Property | Value |
|---|---|
| Category | Asymmetric Ciphers |
| Sub-category | Key Exchange (ECDH) |
| Security status | π‘οΈ Secure |
| Complexity | Advanced |
| Inventor | Daniel J. Bernstein |
| Year | 2006 |
| Origin | πΊπΈ United States |
| Source | algorithms/asymmetric/x25519.js |
Status: π‘οΈ Secure
No vulnerabilities are recorded for this implementation.
18 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β RFC 7748 Section 6.1 - Test Vector 1
| Field | Value |
|---|---|
privateKey |
77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a |
publicKey |
8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a |
otherPublicKey |
de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f |
input |
null |
expected |
4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 |
Vector 2 β RFC 7748 Section 6.1 - Test Vector 2 (Bobβs perspective)
| Field | Value |
|---|---|
privateKey |
5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb |
publicKey |
de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f |
otherPublicKey |
8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a |
input |
null |
expected |
4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 |
Vector 3 β RFC 7748 Section 5.2 - Scalar Multiplication Test Vector 1
| Field | Value |
|---|---|
privateKey |
a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4 |
otherPublicKey |
e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c |
input |
null |
expected |
c3da55379de9c6908e94ea4df28d084f32eccf03491c71f754b4075577a28552 |
Vector 4 β RFC 7748 Section 5.2 - Scalar Multiplication Test Vector 2
| Field | Value |
|---|---|
privateKey |
4b66e9d4d1b4673c5ad22691957d6af5c11b6421e0ea01d42ca4169e7918ba0d |
otherPublicKey |
e5210f12786811d3f4b7959d0538ae2c31dbe7106fc03c3efc4cd549c715a493 |
input |
null |
expected |
95cbde9476e8907d7aade45cb4b873f88b595a68799fa152e6f8f7647aac7957 |
Vector 5 β RFC 7748 Section 5.2 - Iterated Scalar Multiplication (1 iteration)
| Field | Value |
|---|---|
privateKey |
0900000000000000000000000000000000000000000000000000000000000000 |
iterations |
1 |
input |
null |
expected |
422c8e7a6227d7bca1350b3e2bb7279f7897b87bb6854b783c60e80311ae3079 |
Vector 6 β RFC 7748 Section 5.2 - Iterated Scalar Multiplication (1000 iterations)
| Field | Value |
|---|---|
privateKey |
0900000000000000000000000000000000000000000000000000000000000000 |
iterations |
1000 |
input |
null |
expected |
684cf59ba83309552800ef566f2f4d3c1c3887c49360e3875f2eb94d99532c51 |
Vector 7 β Wycheproof - Public key = 0 (low-order point)
| Field | Value |
|---|---|
privateKey |
207494038f2bb811d47805bcdf04a2ac585ada7f2f23389bfd4658f9ddd4debc |
otherPublicKey |
0000000000000000000000000000000000000000000000000000000000000000 |
input |
null |
expected |
0000000000000000000000000000000000000000000000000000000000000000 |
Vector 8 β Wycheproof - Public key = 1 (low-order point)
| Field | Value |
|---|---|
privateKey |
202e8972b61c7e61930eb9450b5070eae1c670475685541f0476217e4818cfab |
otherPublicKey |
0100000000000000000000000000000000000000000000000000000000000000 |
input |
null |
expected |
0000000000000000000000000000000000000000000000000000000000000000 |
Vector 9 β Wycheproof - Edge case on twist
| Field | Value |
|---|---|
privateKey |
38dde9f3e7b799045f9ac3793d4a9277dadeadc41bec0290f81f744f73775f84 |
otherPublicKey |
0200000000000000000000000000000000000000000000000000000000000000 |
input |
null |
expected |
9a2cfe84ff9c4a9739625cae4a3b82a906877a441946f8d7b3d795fe8f5d1639 |
Vector 10 β Wycheproof - Public key on twist
| Field | Value |
|---|---|
privateKey |
588c061a50804ac488ad774ac716c3f5ba714b2712e048491379a500211998a8 |
otherPublicKey |
63aa40c6e38346c5caf23a6df0a5e6c80889a08647e551b3563449befcfc9733 |
input |
null |
expected |
b1a707519495ffffb298ff941716b06dfab87cf8d91123fe2be9a233dda22212 |
Vector 11 β Wycheproof - Edge case for public key (all-zeros variant)
| Field | Value |
|---|---|
privateKey |
386f7f16c50731d64f82e6a170b142a4e34f31fd7768fcb8902925e7d1e21abe |
otherPublicKey |
0400000000000000000000000000000000000000000000000000000000000000 |
input |
null |
expected |
0fcab5d842a078d7a71fc59b57bfb4ca0be6873b49dcdb9f44e14ae8fbdfa542 |
Vector 12 β Wycheproof - Public key >= p (reduction test)
| Field | Value |
|---|---|
privateKey |
f01e48dafac9d7bcf589cbc382c878d18bda3550589ffb5d50b523bebe329dae |
otherPublicKey |
efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f |
input |
null |
expected |
bd36a0790eb883098c988b21786773de0b3a4df162282cf110de18dd484ce74b |
Vector 13 β Wycheproof - Low-order public key test
| Field | Value |
|---|---|
privateKey |
10255c9230a97a30a458ca284a629669293a31890cda9d147febc7d1e22d6bb1 |
otherPublicKey |
e0eb7a7c3b41b8ae1656e3faf19fc46ada098deb9c32b1fd866205165f49b800 |
input |
null |
expected |
0000000000000000000000000000000000000000000000000000000000000000 |
Vector 14 β Wycheproof - Checking for overflow handling
| Field | Value |
|---|---|
privateKey |
c81724704000b26d31703cc97e3a378d56fad8219361c88cca8bd7c5719b12b2 |
otherPublicKey |
fd300aeb40e1fa582518412b49b208a7842b1e1f056a040178ea4141534f652d |
input |
null |
expected |
b734105dc257585d73b566ccb76f062795ccbec89128e52b02f3e59639f13c46 |
Vector 15 β libsodium scalarmult1 - Standard test vector
| Field | Value |
|---|---|
privateKey |
77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a |
otherPublicKey |
0900000000000000000000000000000000000000000000000000000000000000 |
input |
null |
expected |
8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a |
Vector 16 β libsodium scalarmult2 - Standard test vector
| Field | Value |
|---|---|
privateKey |
5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb |
otherPublicKey |
0900000000000000000000000000000000000000000000000000000000000000 |
input |
null |
expected |
de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f |
Vector 17 β curve25519-donna - Non-canonical point test
| Field | Value |
|---|---|
privateKey |
0100000000000000000000000000000000000000000000000000000000000000 |
otherPublicKey |
2500000000000000000000000000000000000000000000000000000000000000 |
input |
null |
expected |
3c7777caf997b264416077665b4e229d0b9548dc0cd81998ddcdc5c8533c797f |
Vector 18 β curve25519-donna - All-bits-set public key
| Field | Value |
|---|---|
privateKey |
0100000000000000000000000000000000000000000000000000000000000000 |
otherPublicKey |
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff |
input |
null |
expected |
b32d1362c248d62fe62619cff04dd43db73ffc1b6308ede30b78d87380f1e834 |