denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.48k stars 5.18k forks source link

P-521 curves in WebCrypto #13449

Open littledivy opened 2 years ago

littledivy commented 2 years ago

Support for p521 curves for ECDSA and ECDH on all relevant operations. Ideally when its part of RustCrypto https://github.com/RustCrypto/elliptic-curves

diachedelic commented 2 years ago

It appears that P-521 is implemented by Mundane, a Rust cryptography library by Google: https://github.com/google/mundane. Would that be considered as an alternative to RustCrypto?

diachedelic commented 2 years ago

And this is the relevant issue for RustCrypto: https://github.com/RustCrypto/elliptic-curves/issues/114.

bartlomieju commented 2 years ago

It appears that P-521 is implemented by Mundane, a Rust cryptography library by Google: https://github.com/google/mundane. Would that be considered as an alternative to RustCrypto?

At this point it's unlikely that we'll switch to another crypto library.

mrmikardo commented 1 year ago

Has there been any update on this issue since last year? It looks like P-521 curves are now supported by the Rust crypto library: https://github.com/RustCrypto/elliptic-curves#crates

Although it does look like some of these are slightly experimental, at this point: https://github.com/RustCrypto/elliptic-curves/issues/114#issuecomment-1427237213

dojyorin commented 6 months ago

P-521 has been implemented upstream (v0.13.3~), I think WebCrypto P-521 implementation has become possible.

dojyorin commented 6 months ago

I'm not familiar with Rust, so it's incomplete, but I feel like it would work if I specifically added code like this.

littledivy commented 6 months ago

Thanks @dojyorin

Some parts of the WebCrypto implementation use ring which does not yet support P521 IIRC. (In the code snippet for generate_key.rs: ring::signature::ECDSA_P521_SHA512_FIXED_SIGNING does not exist)

I've currently started working on moving some parts to the p521 crate and eventually plan to move everything to the RustCrypto group of crates.