cd /news/artificial-intelligence/sanctum-swap-the-classical-ecdh-part… · home › topics › artificial-intelligence › article
[ARTICLE · art-182596] src=github.com ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Sanctum: "Swap the classical ECDH part of the exchange from x25519 to secp384r1"

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.

key 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.

read4 min views1 publishedDec 5, 2026
Sanctum: "Swap the classical ECDH part of the exchange from x25519 to secp384r1"
Image: Michielbdejong (auto-discovered)

| @@ -18,7 +18,7 @@ construction are fixed as there is no risk for (key, nonce) | | 18 | 18 | pair re-use in this specific scenario. | | 19 | 19 | | | 20 | 20 | Key derivation for session keys is done by combing unique | | 21 | | - per-direction shared secrets from ECDH (x25519) and ML-KEM-1024, | | | 21 | + per-direction shared secrets from ECDH and ML-KEM-1024, | | 22 | 22 | together with a derivative of our shared symmetrical key. | | 23 | 23 | | | 24 | 24 | IKM = len(ecdh_ss) || ecdh_ss || len(mlkem1024_ss) || mlkem1024_ss || | | @@ -133,13 +133,13 @@ these can be distributed via a cathedral as an ambry, see docs/cathedral.md. | | 133 | 133 | | | 134 | 134 | Session keys (SK) are derived from the traffic_base_rx or | | 135 | 135 | traffic_base_tx keys in combination with directional unique | | 136 | | - ECDH (x25519) and ML-KEM-1024 shared secrets, using KMAC256() as the KDF. | | | 136 | + ECDH and ML-KEM-1024 shared secrets, using KMAC256() as the KDF. | | 137 | 137 | | | 138 | 138 | Both sides start by sending out offerings that contain an ML-KEM-1024 | | 139 | | - public key and an x25519 public key. | | | 139 | + public key and an ECDH public key. | | 140 | 140 | | | 141 | 141 | Both sides upon receiving these offerings will perform ML-KEM-1024 | | 142 | | - encapsulation and send back the ciphertext and their own x25519 | | | 142 | + encapsulation and send back the ciphertext and their own ECDH | | 143 | 143 | public key which differs from the one sent in the initial offering. | | 144 | 144 | | | 145 | 145 | When a side performs encapsulation it will derive a fresh | | @@ -150,7 +150,7 @@ When a side performs decapsulation it will derive a fresh | | 150 | 150 | TX session key using all of that key material and install the | | 151 | 151 | key as the active TX key. | | 152 | 152 | | | 153 | | - In both cases this results in unique shared secrets for x25519 | | | 153 | + In both cases this results in unique shared secrets for ECDH | | 154 | 154 | and ML-KEM-1024 in each direction, while allowing us to gracefully | | 155 | 155 | install pending RX keys so that we do not miss a beat. | | 156 | 156 | | | @@ -166,7 +166,7 @@ derive_offer_encryption_key(seed): | | 166 | 166 | return wk | | 167 | 167 | |

| `168` | `168` | offer_create(): | 
| `169` |  | `-`    offer.ecdh   = X25519-KEYGEN() | 
|  | `169` | `+`    offer.ecdh   = ECC-KEYGEN() | 
| `170` | `170` |     offer.kem    = ML-KEM-1024-KEYGEN() | 
| `171` | `171` |     offer.now    = TIME(WALL_CLOCK), 64-bit | 
| `172` | `172` |     offer.id     = PRNG(64-bit), unique sanctum id | 
| @@ -204,7 +204,7 @@ offer_recv_pk(offer): | 

| 204 | 204 | dk = derive_offer_encryption_key(packet.header.seed) | | 205 | 205 | pt = AES256-GCM(dk, nonce=1, aad=packet.header, packet.data) | | 206 | 206 | |

| `207` |  | `-`    ecdh_ss = X25519-SCALAR-MULT(pt.ecdh.pub, offer.ecdh.private) | 
|  | `207` | `+`    ecdh_ss = ECC-DERIVE(pt.ecdh.pub, offer.ecdh.private) | 
| `208` | `208` |     offer.kem.ct, kem_ss = ML-KEM-1024-ENCAP(pt.kem.pk) | 

| 209 | 209 | | | 210 | 210 | if pt.instance < local_id | | @@ -249,7 +249,7 @@ offer_recv_ct(offer): | | 249 | 249 | dk = derive_offer_encryption_key(packet.header.seed) | | 250 | 250 | pt = AES256-GCM(dk, nonce=1, aad=packet.header, packet.data) | | 251 | 251 | |

| `252` |  | `-`    ecdh_ss = X25519-SCALAR-MULT(pt.ecdh.pub, offer.ecdh.private) | 
|  | `252` | `+`    ecdh_ss = ECC-DERIVE(pt.ecdh.pub, offer.ecdh.private) | 
| `253` | `253` |     kem_ss = ML-KEM-1024-DECAP(offer.kem, pt.kem.ct) | 

| 254 | 254 | | | 255 | 255 | if pt.instance < local_id | | |

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @sanctum 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/sanctum-swap-the-cla…] indexed:0 read:4min 2026-12-05 · —