secp256k1

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2016 License: GPL-3.0 Imports: 4 Imported by: 0

README

secp256k1-go

golang secp256k1 library

Implements cryptographic operations for the secp256k1 ECDSA curve used by Bitcoin.

Installing

GMP library headers are required to build. On Debian-based systems, the package is called libgmp-dev.

sudo apt-get install libgmp-dev

Now compiles with cgo!

Test

To run tests do

go tests

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMsgLen       = errors.New("invalid message length for signature recovery")
	ErrInvalidSignatureLen = errors.New("invalid signature length")
	ErrInvalidRecoveryID   = errors.New("invalid signature recovery id")
)

Functions

func GenerateKeyPair

func GenerateKeyPair() ([]byte, []byte)

func GeneratePubKey

func GeneratePubKey(seckey []byte) ([]byte, error)

func RecoverPubkey

func RecoverPubkey(msg []byte, sig []byte) ([]byte, error)

RecoverPubkey returns the the public key of the signer. msg must be the 32-byte hash of the message to be signed. sig must be a 65-byte compact ECDSA signature containing the recovery id as the last element.

func Sign

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

func VerifySeckeyValidity

func VerifySeckeyValidity(seckey []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