secp256k1

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPubKey

func GetPubKey(pk []byte) (address.Address, error)

GetPubKey returns the public key from the private key.

func Sign

func Sign(pk []byte, msg []byte) ([]byte, error)

Sign creates a secp256k1 signature of a message using a private key. The private byte slice should be exactly as implemented in an official Filecoin client. The signature is also compatible with a Filecoin client. It has format R|S|V where V is 0 or 1, allowing recovering the public key only using the signature.

func Verify added in v0.3.0

func Verify(pubkey, msg, sig []byte) bool

Verify verifies that a message is correctly signed by a public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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