-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ECDSAPrivateKey.ECDH which takes a *ecdh.PublicKey
The current ECDSAPrivateKey.SharedKey method takes a *ecdsa.PublicKey. However, using crypto/ecdsa and crypto/elliptic for ECDH has been deprecated in the standard library in favor of crypto/ecdh. This commit adds a new ECDH method to ECDSAPrivateKey which takes a *ecdh.PublicKey. This method has the same signature as ecdh.PrivateKey.ECDH, meaning the following interface can be be used to do ECDH with both standard library private keys and piv-go keys, providing the same flexibility as crypto.Signer and crypto.Decrypter: interface { ECDH(*ecdh.PublicKey) ([]byte, error) } ECDSAPrivateKey.SharedKey has been re-implemented as a small wrapper around ECDSAPrivateKey.ECDH.
- Loading branch information
1 parent
2cbba92
commit 7988525
Showing
2 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters