You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
π Bug Report β Runtime APIs: node:crypto diffieHellman fails for an imported X25519 public keyΒ #7743
With nodejs_compat, crypto.diffieHellman works for X25519 keys from generateKeyPairSync, and for a public key from createPublicKey(privateKeyObject). It throws Failed to derive shared diffie-hellman secret when the public key is imported from bytes, as SPKI DER or as JWK. The same code works in Node.js 22.
Seen with workerd 1.20261001.1 (wrangler 4.147.0), compatibility date 2026-10-01.
imported.asymmetricKeyType is 'x25519'. Importing as JWK ({ kty: 'OKP', crv: 'X25519', x }) fails the same way.
This blocks any protocol where the peer's public key arrives as bytes, such as a Noise handshake. We work around it with @noble/curves for the X25519 step.
Related: #3684, which added X25519 support to stateless diffieHellman.
Activity