WebCrypto support for Ed25519?

The docs say to make a request here. Ed25519 seems to be popular with some services for verifying signatures of serverless requests. Seems like it would be useful to have Worker WebCrypto support for it.

Thanks

3 Likes

If this were to be done, it seems there’s prior work here:

You can get ed25519 today on Workers if you use WASM. There are some pure JS implementations but the ones I tested take you over the CPU time limit. I wouldn’t hold my breath while waiting for amendments to web standards.

https://www.chromestatus.com/feature/4913922408710144

https://groups.google.com/a/chromium.org/g/blink-dev/c/PgBVW4ru1EQ/m/5dllcdVoDgAJ

All WASM alternatives I tested for new crypto algos (Argon2, SIDH, ed25519) take an outrageous amount of time compared to native implementations of current algorithms (like 800x, 3000x). Impact on main thread can be mitigated by performing such operations in web workers.

1 Like

Even the Rust implementations of WASM are slower than native implementations, I’d suggest waiting until Cloudflare can offer such features inside workers.

1 Like

Node.js recently shipped an extension to its WebCrypto implementation which allows the use of Ed25519 (algo named NODE-ED25519). Perhaps CF could do something similar?

1 Like

This was added; 2021/6/25 Workers Runtime Release Notes

It’s just like node’s implementation as far as I can tell… Simply verify something with: await crypto.subtle.verify('NODE-ED25519', ...);, and import the key with await crypto.subtle.importKey(..., { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' }, ..., ['verify']);.