ecdh

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Curve

type Curve interface {
	GenerateKey(rand io.Reader) (*PrivateKey, error)
	NewPrivateKey(key []byte) (*PrivateKey, error)
	NewPublicKey(key []byte) (*PublicKey, error)
	// contains filtered or unexported methods
}

func P256

func P256() Curve

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

func (*PrivateKey) Bytes

func (k *PrivateKey) Bytes() []byte

func (*PrivateKey) Curve

func (k *PrivateKey) Curve() Curve

func (*PrivateKey) ECDH

func (k *PrivateKey) ECDH(remote *PublicKey) ([]byte, error)

func (*PrivateKey) Equal

func (k *PrivateKey) Equal(x crypto.PrivateKey) bool

func (*PrivateKey) Public

func (k *PrivateKey) Public() crypto.PublicKey

func (*PrivateKey) PublicKey

func (k *PrivateKey) PublicKey() *PublicKey

func (*PrivateKey) SM2MQV

func (k *PrivateKey) SM2MQV(eLocal *PrivateKey, sRemote, eRemote *PublicKey) (*PublicKey, error)

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func (*PublicKey) Bytes

func (k *PublicKey) Bytes() []byte

func (*PublicKey) Curve

func (k *PublicKey) Curve() Curve

func (*PublicKey) Equal

func (k *PublicKey) Equal(x crypto.PublicKey) bool

func (*PublicKey) SM2SharedKey

func (uv *PublicKey) SM2SharedKey(isResponder bool, kenLen int, sPub, sRemote *PublicKey, uid []byte, remoteUID []byte) ([]byte, error)

func (*PublicKey) SM2ZA

func (k *PublicKey) SM2ZA(md hash.Hash, uid []byte) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL