crypto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EcRecover

func EcRecover(hash, sig []byte) ([]byte, error)

func Keccak256

func Keccak256(data ...[]byte) []byte

func NewPrivateKey

func NewPrivateKey(privateKeyBytes []byte) (*ecdsa.PrivateKey, error)

func NewPrivateKeyByHex

func NewPrivateKeyByHex(privateKeyHex string) (*ecdsa.PrivateKey, error)

func PersonalEcRecover

func PersonalEcRecover(data []byte, sig []byte) (string, error)

func PersonalSign

func PersonalSign(message []byte, privateKey string) ([]byte, error)

func PersonalSignByPrivateKey

func PersonalSignByPrivateKey(message []byte, privateKey *ecdsa.PrivateKey) ([]byte, error)

func PubKey2Address

func PubKey2Address(p ecdsa.PublicKey) string

func PubKey2Bytes

func PubKey2Bytes(pub *ecdsa.PublicKey) []byte

func SigToPub

func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error)

func Sign

func Sign(hash []byte, prv *ecdsa.PrivateKey) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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