crypto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateKey

type PrivateKey struct {
	Key *ecdsa.PrivateKey
}

func GeneratePrivateKey

func GeneratePrivateKey() PrivateKey

func PrivateKeyFromBytes

func PrivateKeyFromBytes(data []byte) (PrivateKey, error)

func (PrivateKey) PublicKey

func (k PrivateKey) PublicKey() PublicKey

func (PrivateKey) Sign

func (k PrivateKey) Sign(data []byte) (*Signature, error)

func (PrivateKey) ToBytes

func (k PrivateKey) ToBytes() []byte

type PublicKey

type PublicKey struct {
	Key *ecdsa.PublicKey
}

func PublicKeyFromBytes

func PublicKeyFromBytes(data []byte) (PublicKey, error)

func (PublicKey) Address

func (k PublicKey) Address() types.Address

func (PublicKey) ToBytes

func (k PublicKey) ToBytes() []byte

func (PublicKey) ToSlice

func (k PublicKey) ToSlice() []byte

type Signature

type Signature struct {
	S, R *big.Int
}

func (Signature) Verify

func (sig Signature) Verify(pubKey PublicKey, data []byte) bool

Jump to

Keyboard shortcuts

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