Skip to content
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

Add ECDSAPrivateKey.ECDH which takes a *ecdh.PublicKey #158

Merged
merged 1 commit into from
Oct 2, 2024

Commits on Oct 2, 2024

  1. 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.
    AGWA committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    ffbd58f View commit details
    Browse the repository at this point in the history