core

package
v0.0.0-...-25c57ca Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivateKeyBytesLen = 32
)

Variables

This section is empty.

Functions

func DoubleSha256Bytes

func DoubleSha256Bytes(b []byte) []byte

func DoubleSha256Hash

func DoubleSha256Hash(b []byte) utils.Hash

func Sha256Bytes

func Sha256Bytes(b []byte) []byte

func Sha256Hash

func Sha256Hash(b []byte) utils.Hash

func Sign

func Sign(privKey *PrivateKey, hash []byte) ([]byte, error)

Types

type PrivateKey

type PrivateKey struct {
	PublicKey *PublicKey
	D         *big.Int
}

func PrivateKeyFromBytes

func PrivateKeyFromBytes(privateKeyBytes []byte) *PrivateKey

func (*PrivateKey) PubKey

func (privateKey *PrivateKey) PubKey() *PublicKey

func (*PrivateKey) Serialize

func (privateKey *PrivateKey) Serialize() []byte

func (*PrivateKey) Sign

func (privateKey *PrivateKey) Sign(hash []byte) (*Signature, error)

type PublicKey

type PublicKey secp256k1.PublicKey

func ParsePubKey

func ParsePubKey(pubKeyStr []byte) (*PublicKey, error)

func (*PublicKey) IsEqual

func (publicKey *PublicKey) IsEqual(otherPublicKey *PublicKey) bool

func (*PublicKey) SerializeCompressed

func (publicKey *PublicKey) SerializeCompressed() []byte

func (*PublicKey) SerializeUncompressed

func (publicKey *PublicKey) SerializeUncompressed() []byte

func (*PublicKey) ToSecp256k

func (publicKey *PublicKey) ToSecp256k() *secp256k1.PublicKey

type Signature

type Signature secp256k1.EcdsaSignature

func ParseDERSignature

func ParseDERSignature(signature []byte) (*Signature, error)

func ParseSignature

func ParseSignature(signature []byte) (*Signature, error)

func (*Signature) Serialize

func (sig *Signature) Serialize() []byte

func (*Signature) Verify

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

Jump to

Keyboard shortcuts

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