crypto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Address

func Address(pubkey string) string

TODO only from pubkey type

func FaucetTx

func FaucetTx()

TODO

func GetMD5Hash

func GetMD5Hash(text string) string

func GetSHAHash

func GetSHAHash(text string) string

func MsgHash

func MsgHash(message string) []byte

func PrivKeyFromHex

func PrivKeyFromHex(hexString string) btcec.PrivateKey

func PrivKeyToHex

func PrivKeyToHex(privkey btcec.PrivateKey) string

func PubFromSecret

func PubFromSecret(secret string) btcec.PublicKey

func PubHexFromSecret

func PubHexFromSecret() string

func PubKeyFromHex

func PubKeyFromHex(hexString string) btcec.PublicKey

func PubKeyToHex

func PubKeyToHex(pubkey btcec.PublicKey) string

func RandomPublicKey

func RandomPublicKey() string

func RemovePubTx

func RemovePubTx(tx block.Tx) block.Tx

func RemoveSigTx

func RemoveSigTx(tx block.Tx) block.Tx

func Sign

func Sign(keypair Keypair, message string) btcec.Signature

func SignMsgHash

func SignMsgHash(keypair Keypair, message string) btcec.Signature

func SignTx

func SignTx(tx block.Tx, keypair Keypair) btcec.Signature

func SignTxAdd

func SignTxAdd(tx block.Tx, keypair Keypair) block.Tx

sign tx and add signature and pubkey

func SignatureFromHex

func SignatureFromHex(hexString string) btcec.Signature

Decode hex-encoded serialized signature

func SignatureToHex

func SignatureToHex(sig btcec.Signature) string

func TxHash

func TxHash(tx block.Tx) [32]byte

hash of a transaction, currently sha256 of the nonce TODO hash properly

func VerifyMessageSign

func VerifyMessageSign(signature btcec.Signature, keypair Keypair, message string) bool

func VerifyMessageSignPub

func VerifyMessageSignPub(signature btcec.Signature, pubkey btcec.PublicKey, message string) bool

func VerifyTxSig

func VerifyTxSig(tx block.Tx) bool

Types

type Keypair

type Keypair struct {
	PrivKey btcec.PrivateKey
	PubKey  btcec.PublicKey
}

func PairFromHex

func PairFromHex(hexString string) Keypair

func PairFromSecret

func PairFromSecret(secret string) Keypair

Jump to

Keyboard shortcuts

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