{"slug": "sanctum-swap-the-classical-ecdh-part-of-the-exchange-from-x25519-to-secp384r1", "title": "Sanctum: \"Swap the classical ECDH part of the exchange from x25519 to secp384r1\"", "summary": "Sanctum published a specification change replacing the x25519 classical ECDH component of its hybrid key exchange with a generic ECC key exchange, with the commit message directing that the classical part be swapped from x25519 to secp384r1. The updated spec keeps ML-KEM-1024 as the post-quantum half, deriving per-direction session keys via KMAC256 from the ECDH and ML-KEM-1024 shared secrets combined with a derivative of the shared symmetrical key, and renames the pseudocode calls from X25519-KEYGEN and X25519-SCALAR-MULT to ECC-KEYGEN and ECC-DERIVE. The change matters because it moves Sanctum's hybrid handshake off a fixed curve without altering the ML-KEM-1024 encapsulation flow or the pending RX key installation that avoids dropping traffic.", "body_md": "| @@ -18,7 +18,7 @@ construction are fixed as there is no risk for (key, nonce) | \n| `18` | `18` | pair re-use in this specific scenario. | \n| `19` | `19` |  | \n| `20` | `20` | Key derivation for session keys is done by combing unique | \n| `21` |  | `-` per-direction shared secrets from ECDH (x25519) and ML-KEM-1024, | \n|  | `21` | `+` per-direction shared secrets from ECDH and ML-KEM-1024, | \n| `22` | `22` | together with a derivative of our shared symmetrical key. | \n| `23` | `23` |  | \n| `24` | `24` | IKM = len(ecdh_ss) \\|\\| ecdh_ss \\|\\| len(mlkem1024_ss) \\|\\| mlkem1024_ss \\|\\| | \n| @@ -133,13 +133,13 @@ these can be distributed via a cathedral as an ambry, see docs/cathedral.md. | \n| `133` | `133` |  | \n| `134` | `134` | Session keys (SK) are derived from the **traffic_base_rx** or | \n| `135` | `135` | **traffic_base_tx** keys in combination with directional unique | \n| `136` |  | `-` ECDH (x25519) and ML-KEM-1024 shared secrets, using KMAC256() as the KDF. | \n|  | `136` | `+` ECDH and ML-KEM-1024 shared secrets, using KMAC256() as the KDF. | \n| `137` | `137` |  | \n| `138` | `138` | Both sides start by sending out offerings that contain an ML-KEM-1024 | \n| `139` |  | `-` public key and an x25519 public key. | \n|  | `139` | `+` public key and an ECDH public key. | \n| `140` | `140` |  | \n| `141` | `141` | Both sides upon receiving these offerings will perform ML-KEM-1024 | \n| `142` |  | `-` encapsulation and send back the ciphertext and their own x25519 | \n|  | `142` | `+` encapsulation and send back the ciphertext and their own ECDH | \n| `143` | `143` | public key which differs from the one sent in the initial offering. | \n| `144` | `144` |  | \n| `145` | `145` | When a side performs encapsulation it will derive a fresh | \n| @@ -150,7 +150,7 @@ When a side performs decapsulation it will derive a fresh | \n| `150` | `150` | TX session key using all of that key material and install the | \n| `151` | `151` | key as the active TX key. | \n| `152` | `152` |  | \n| `153` |  | `-` In both cases this results in unique shared secrets for x25519 | \n|  | `153` | `+` In both cases this results in unique shared secrets for ECDH | \n| `154` | `154` | and ML-KEM-1024 in each direction, while allowing us to gracefully | \n| `155` | `155` | install pending RX keys so that we do not miss a beat. | \n| `156` | `156` |  | \n| @@ -166,7 +166,7 @@ derive_offer_encryption_key(seed): | \n| `166` | `166` |     return wk | \n| `167` | `167` |  | \n| `168` | `168` | offer_create(): | \n| `169` |  | `-`    offer.ecdh   = X25519-KEYGEN() | \n|  | `169` | `+`    offer.ecdh   = ECC-KEYGEN() | \n| `170` | `170` |     offer.kem    = ML-KEM-1024-KEYGEN() | \n| `171` | `171` |     offer.now    = TIME(WALL_CLOCK), 64-bit | \n| `172` | `172` |     offer.id     = PRNG(64-bit), unique sanctum id | \n| @@ -204,7 +204,7 @@ offer_recv_pk(offer): | \n| `204` | `204` |     dk = derive_offer_encryption_key(packet.header.seed) | \n| `205` | `205` |     pt = AES256-GCM(dk, nonce=1, aad=packet.header, packet.data) | \n| `206` | `206` |  | \n| `207` |  | `-`    ecdh_ss = X25519-SCALAR-MULT(pt.ecdh.pub, offer.ecdh.private) | \n|  | `207` | `+`    ecdh_ss = ECC-DERIVE(pt.ecdh.pub, offer.ecdh.private) | \n| `208` | `208` |     offer.kem.ct, kem_ss = ML-KEM-1024-ENCAP(pt.kem.pk) | \n| `209` | `209` |  | \n| `210` | `210` |     if pt.instance < local_id | \n| @@ -249,7 +249,7 @@ offer_recv_ct(offer): | \n| `249` | `249` |     dk = derive_offer_encryption_key(packet.header.seed) | \n| `250` | `250` |     pt = AES256-GCM(dk, nonce=1, aad=packet.header, packet.data) | \n| `251` | `251` |  | \n| `252` |  | `-`    ecdh_ss = X25519-SCALAR-MULT(pt.ecdh.pub, offer.ecdh.private) | \n|  | `252` | `+`    ecdh_ss = ECC-DERIVE(pt.ecdh.pub, offer.ecdh.private) | \n| `253` | `253` |     kem_ss = ML-KEM-1024-DECAP(offer.kem, pt.kem.ct) | \n| `254` | `254` |  | \n| `255` | `255` |     if pt.instance < local_id | \n|  |", "url": "https://wpnews.pro/news/sanctum-swap-the-classical-ecdh-part-of-the-exchange-from-x25519-to-secp384r1", "canonical_source": "https://github.com/jorisvink/sanctum/commit/c0972c36ad9fcbd790427a08d7e8ea1cc2327d9e", "published_at": "2026-12-05 21:22:44+00:00", "updated_at": "2026-12-05 21:46:32.239561+00:00", "lang": "en", "topics": ["artificial-intelligence"], "entities": ["Sanctum", "ML-KEM-1024", "x25519", "secp384r1", "KMAC256", "AES256-GCM"], "also_reported_by": [], "takeaway": "Sanctum's hybrid handshake now derives session keys via KMAC256 from an ECC (secp384r1) shared secret plus an ML-KEM-1024 shared secret, so implementations must replace X25519-KEYGEN/X25519-SCALAR-MULT with ECC-KEYGEN/ECC-DERIVE.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/sanctum-swap-the-classical-ecdh-part-of-the-exchange-from-x25519-to-secp384r1", "markdown": "https://wpnews.pro/news/sanctum-swap-the-classical-ecdh-part-of-the-exchange-from-x25519-to-secp384r1.md", "text": "https://wpnews.pro/news/sanctum-swap-the-classical-ecdh-part-of-the-exchange-from-x25519-to-secp384r1.txt", "jsonld": "https://wpnews.pro/news/sanctum-swap-the-classical-ecdh-part-of-the-exchange-from-x25519-to-secp384r1.jsonld"}}