eth

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(message []byte) []byte

Hash calculates a hash for given message using Ethereum crypto functions

func NewKey

func NewKey() (*ecdsa.PrivateKey, error)

NewKey generates new secp256k1 key using Ethereum crypto functions

func PrivateKeyBytes

func PrivateKeyBytes(privateKey *ecdsa.PrivateKey) []byte

PrivateKeyBytes returns bytes representation of secp256p1 private key

func PrivateKeyFromBytes

func PrivateKeyFromBytes(bytes []byte) (*ecdsa.PrivateKey, error)

PrivateKeyFromBytes creates a secp256k1 private key from its bytes representation

func PublicKeyBytes

func PublicKeyBytes(publicKey *ecdsa.PublicKey) []byte

PublicKeyBytes returns bytes representation of secp256p1 public key

func Sign

func Sign(digest []byte, privateKey *ecdsa.PrivateKey) ([]byte, error)

Sign calculates an ECDSA signature using Ethereum crypto functions

func Verify

func Verify(publicKey, digest, signature []byte) bool

Verify checks that the given public key created signature over digest using Ethereum crypto functions

Types

This section is empty.

Jump to

Keyboard shortcuts

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