Uh oh!
There was an error while loading. Please reload this page.
crypto: add generatePublicKey to ECDH, fix corner cases - #4124
Conversation
ECDH.generatePublicKey can get the public key using the curve and private key. This allows usage of the crypto module where a developer imports a private key, and then generates a public key without needing it stored. Removed the generated_ boolean from the ECDH class, and stopped checking for it with getPrivateKey() and getPublicKey(). This allows you to import public and private keys without having to generate first, which would just rewrite the generated keys regardless. An error message was changed to accurately reflect what the error was.
Change the function name of generatePublicKey to be generatePublicKey instead of generateKeys.
mscdex
commented
Dec 3, 2015
Would it be possible to implicitly cache the generated keys to avoid repeated calculations? |
jasnell
commented
Dec 3, 2015
@nodejs/crypto |
Trott
commented
Dec 4, 2015
@mscdex I want to make sure I understand what you're asking. You're talking about basically the same thing as the conversation starting at https://github.com/nodejs/node/pull/1020/files#r25941472 was about, right? It's about how to make sure we don't needlessly go through the work of generating the public key from the private key more than once? |
mscdex
commented
Dec 4, 2015
@Trott Pretty much. |
mruddy
commented
Dec 4, 2015
You guys should check what we've got ready for #3511 to make sure you're not repeating effort. |
Trott
commented
Dec 5, 2015
mruddy
commented
Dec 5, 2015
@Trott Yep, agreed, exactly what I was thinking. |
bnoordhuis
commented
Dec 7, 2015
FWIW, I just landed #3511. Should this be closed? |
mruddy
commented
Dec 7, 2015
@Trott@bnoordhuis Yep, with the landing of #3511, I believe that this, #4124, and #1020 can now be closed. |
bnoordhuis
commented
Dec 7, 2015
Okay, closing. Thanks. |
This is #1020 rebased against master and with the nits fixed up.
From original PR: