crypto

package
v0.0.0-...-da19eeb Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPadding

func AddPadding(src []byte) []byte

func Decode

func Decode(wif string) ([]byte, error)

Decode can be used to turn WIF into a raw private key (32 bytes).

func DecryptCBC

func DecryptCBC(data, iv, key []byte) (decryptedData []byte, err error)

func EncryptCBC

func EncryptCBC(data, iv, key []byte) (encryptedData []byte, err error)

func GetAddressString

func GetAddressString(prefix string, key *btcec.PublicKey) string

func GetPrivateKey

func GetPrivateKey(wif string) (*btcec.PrivateKey, error)

func GetPublicKey

func GetPublicKey(wif string) ([]byte, error)

GetPublicKey returns the public key associated with the given WIF in the 33-byte compressed format.

func GetPublicKeyString

func GetPublicKeyString(prefix string, key *btcec.PublicKey) string

func GetSharedSecret

func GetSharedSecret(from *btcec.PrivateKey, to *btcec.PublicKey) []byte

func ParsePublicKey

func ParsePublicKey(key string) *btcec.PublicKey

ParsePublicKey parses address to public key, returns nil on error

func RemovePadding

func RemovePadding(b []byte) ([]byte, error)

Types

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

func NewSignature

func NewSignature(sig []byte) *Signature

func Sign

func Sign(data []byte, privKey *btcec.PrivateKey) (*Signature, error)

func SignDigest

func SignDigest(digest []byte, privKey *btcec.PrivateKey) (*Signature, error)

func (*Signature) Bytes

func (p *Signature) Bytes() []byte

func (*Signature) IsCanonical

func (p *Signature) IsCanonical() bool

func (*Signature) ToHex

func (p *Signature) ToHex() string

Jump to

Keyboard shortcuts

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