-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ecdh.setPublicKey
is actually useful and should be undeprecated
#18977
Comments
/cc @nodejs/crypto |
Technically correct but it's probably better to add an explicit conversion method instead of undeprecating @skerit When does this come up? I'd expect most applications to be agnostic to the point format. |
Ah well, this is related to my comment on issue #18147 "Signing with a ecdh type private key": Since But yeah, an new method for converting the compressed key would be better :) |
Okay, I've added labels. Pull request welcome and happy to answer questions. |
@bnoordhuis Can I pick this up? I think it'll be a good first issue :) |
@wuweiweiwu Sure thing. |
@bnoordhuis I was thinking of adding another method Is that a good place to start? Thank you |
@wuweiweiwu I'd make it a static method (i.e. on (Three ways actually because node can also convert to a hybrid format.) |
@bnoordhuis sounds good! I will work on the compress and uncompress. Where can I find more information on the hybrid format? And is it ok if I put the tests in |
It's the
Yep. |
Just a question about converting buffer to point. Currently I have Should I declare Perhaps using Thank you! |
I'd probably move the shared logic into a static ECDH member function. It doesn't matter if it's not a member, as long as there isn't code duplication. |
Sounds good! On it |
ECDH.convertKey is used to convert public keys between different formats. Fixes: nodejs#18977
ECDH.convertKey is used to convert public keys between different formats. PR-URL: nodejs#19080 Fixes: nodejs#18977 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
So
ecdh.setPublicKey
has been deprecated since v5.2.0, but there is a certain use case where it is very useful: when you need to uncompress a compressed public key.Here's how I would uncompress such a public key:
If
ecdh.setPublicKey
where to disappear I would require another library just for this simple task.The text was updated successfully, but these errors were encountered: