ec

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: LGPL-3.0 Imports: 8 Imported by: 39 modules, 45 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructPrivateKey

func ConstructPrivateKey(data []byte, curve elliptic.Curve) (*ecdsa.PrivateKey, error)

func DecodePublicKey

func DecodePublicKey(data []byte, curve elliptic.Curve) (*ecdsa.PublicKey, error)

func EncodePublicKey

func EncodePublicKey(key *ecdsa.PublicKey, compressed bool) []byte

func GenerateECKeyPair

func GenerateECKeyPair(c elliptic.Curve, rand io.Reader, alg ECAlgorithm) (*PrivateKey, *PublicKey, error)

func ValidatePoint added in v1.2.3

func ValidatePoint(curve elliptic.Curve, x, y *big.Int) error

ValidatePoint checks that (x, y) is a valid, non-infinity affine point on the given curve. Both coordinates must be non-nil, non-negative, strictly less than the field prime and satisfy the curve equation.

Types

type ECAlgorithm

type ECAlgorithm byte
const (
	ECDSA ECAlgorithm = iota
	SM2
)

type EthereumPrivateKey added in v1.1.0

type EthereumPrivateKey struct {
	*ecdsa.PrivateKey
}

type EthereumPublicKey added in v1.1.0

type EthereumPublicKey struct {
	*ecdsa.PublicKey
}

type PrivateKey

type PrivateKey struct {
	Algorithm ECAlgorithm
	*ecdsa.PrivateKey
}

func (*PrivateKey) Public

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

type PublicKey

type PublicKey struct {
	Algorithm ECAlgorithm
	*ecdsa.PublicKey
}

Jump to

Keyboard shortcuts

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