oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.11k stars 2.77k forks source link

crypto.generateKeyPairSync: The operation is not supported. x25519 #13795

Open jlucaso1 opened 2 months ago

jlucaso1 commented 2 months ago

What version of Bun is running?

1.1.27+267afa293

What platform is your computer?

Linux 6.8.0-40-generic x86_64 x86_64

What steps can reproduce the bug?

import {generateKeyPairSync} from "crypto"

generateKeyPairSync(
  'x25519',
  {
      publicKeyEncoding: { format: 'der', type: 'spki' },
      privateKeyEncoding: { format: 'der', type: 'pkcs8' }
  }
);

What is the expected behavior?

Don't throw error

What do you see instead?

NotSupportedError: The operation is not supported.
      at node:crypto:66

Additional information

at https://bun.sh/docs/runtime/nodejs-apis#node-crypto shows that generateKeyPairSync is implemented, but is it only partial?

roysG commented 1 month ago

any update?

jlucaso1 commented 1 month ago

any update?

I'm trying to implement, but with no success https://github.com/oven-sh/bun/pull/13798