Documentation ¶
Overview ¶
Package ecdh has implementations for different asymmetric key exchange. Based on the Elliptic Curve Diffie-Hellman key agreement protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEphemeralGenerate generic error when failing to geneate ephemeral keys ErrEphemeralGenerate = errors.New("ecdh: ephemeral generation failed") ErrSharedSecretGenerate = errors.New("ecdh: shared secret generation failed") )
Functions ¶
This section is empty.
Types ¶
type ED25519 ¶
type ED25519 struct {
// contains filtered or unexported fields
}
func (ED25519) EphemeralKey ¶
func (ED25519) SharedSecret ¶
func (kx ED25519) SharedSecret(privateKey crypto.PrivateKey, publicKey crypto.PublicKey) ([]byte, error)
SharedSecret computes a secret value from a private / public key pair. On sending a message the private key should be an ephemeralKey or generated private key, the public key is the recipient public key. On reading a message the private key is the recipient private key, the public key is the ephemeralKey or generated public key.
type SECP256K1 ¶
type SECP256K1 struct {
// contains filtered or unexported fields
}
func (SECP256K1) EphemeralKey ¶
func (SECP256K1) SharedSecret ¶
func (kx SECP256K1) SharedSecret(privateKey crypto.PrivateKey, publicKey crypto.PublicKey) ([]byte, error)
SharedSecret computes a secret value from a private / public key pair. On sending a message the private key should be an ephemeralKey or generated private key, the public key is the recipient public key. On reading a message the private key is the recipient private key, the public key is the ephemeralKey or generated public key.
type SR25519 ¶
type SR25519 struct {
// contains filtered or unexported fields
}
func (SR25519) EphemeralKey ¶
func (SR25519) SharedSecret ¶
func (kx SR25519) SharedSecret(privateKey crypto.PrivateKey, publicKey crypto.PublicKey) ([]byte, error)
SharedSecret computes a secret value from a private / public key pair. On sending a message the private key should be an ephemeralKey or generated private key, the public key is the recipient public key. On reading a message the private key is the recipient private key, the public key is the ephemeralKey or generated public key.