Versions in this module Expand all Collapse all v0 v0.1.0 Dec 10, 2018 Changes in this version + const PSignatureTypeEd25519 + const PSignatureTypeSecp256k1 + const PrivKeyTypeEd25519 + const PrivKeyTypeSecp256k1 + const PubKeyTypeEd25519 + const PubKeyTypeSecp256k1 + const SignatureTypeEd25519 + const SignatureTypeSecp256k1 + func CRandBytes(numBytes int) []byte + func CRandHex(numDigits int) string + func CReader() io.Reader + func DecodeArmor(armorStr string) (blockType string, headers map[string]string, data []byte, err error) + func DecryptSymmetric(ciphertext []byte, secret []byte) (plaintext []byte, err error) + func EncodeArmor(blockType string, headers map[string]string, data []byte) string + func EncryptSymmetric(plaintext []byte, secret []byte) (ciphertext []byte) + func MixEntropy(seedBytes []byte) + func Ripemd160(bytes []byte) []byte + func Sha256(bytes []byte) []byte + type PrivKey interface + Bytes func() []byte + Equals func(PrivKey) bool + KeyString func() string + PubKey func() PubKey + Sign func(msg []byte) Signature + String func() string + type PrivKeyEd25519 [64]byte + func GenPrivKeyEd25519() PrivKeyEd25519 + func GenPrivKeyEd25519FromSecret(secret []byte) PrivKeyEd25519 + func (privKey *PrivKeyEd25519) Bytes() []byte + func (privKey *PrivKeyEd25519) Equals(other PrivKey) bool + func (privKey *PrivKeyEd25519) KeyString() string + func (privKey *PrivKeyEd25519) MarshalJSON() ([]byte, error) + func (privKey *PrivKeyEd25519) PubKey() PubKey + func (privKey *PrivKeyEd25519) Sign(msg []byte) Signature + func (privKey *PrivKeyEd25519) String() string + func (privKey *PrivKeyEd25519) ToCurve25519() *[32]byte + func (privKey *PrivKeyEd25519) UnmarshalJSON(data []byte) error + type PrivKeySecp256k1 [32]byte + func GenPrivKeySecp256k1() PrivKeySecp256k1 + func GenPrivKeySecp256k1FromSecret(secret []byte) PrivKeySecp256k1 + func (privKey *PrivKeySecp256k1) Bytes() []byte + func (privKey *PrivKeySecp256k1) Equals(other PrivKey) bool + func (privKey *PrivKeySecp256k1) KeyString() string + func (privKey *PrivKeySecp256k1) MarshalJSON() ([]byte, error) + func (privKey *PrivKeySecp256k1) PubKey() PubKey + func (privKey *PrivKeySecp256k1) Sign(msg []byte) Signature + func (privKey *PrivKeySecp256k1) String() string + func (privKey *PrivKeySecp256k1) UnmarshalJSON(data []byte) error + type PubKey interface + Address func() []byte + Bytes func() []byte + Equals func(PubKey) bool + KeyString func() string + String func() string + VerifyBytes func(msg []byte, sig Signature) bool + func PubKeyFromBytes(tp byte, pubKeyBytes []byte) (pubKey PubKey, err error) + type PubKeyEd25519 [32]byte + func (pubKey *PubKeyEd25519) Address() []byte + func (pubKey *PubKeyEd25519) Bytes() []byte + func (pubKey *PubKeyEd25519) Equals(other PubKey) bool + func (pubKey *PubKeyEd25519) KeyString() string + func (pubKey *PubKeyEd25519) MarshalJSON() ([]byte, error) + func (pubKey *PubKeyEd25519) String() string + func (pubKey *PubKeyEd25519) ToCurve25519() *[32]byte + func (pubKey *PubKeyEd25519) UnmarshalJSON(data []byte) error + func (pubKey *PubKeyEd25519) VerifyBytes(msg []byte, sig_ Signature) bool + type PubKeySecp256k1 [64]byte + func (pubKey *PubKeySecp256k1) Address() []byte + func (pubKey *PubKeySecp256k1) Bytes() []byte + func (pubKey *PubKeySecp256k1) Equals(other PubKey) bool + func (pubKey *PubKeySecp256k1) KeyString() string + func (pubKey *PubKeySecp256k1) MarshalJSON() ([]byte, error) + func (pubKey *PubKeySecp256k1) String() string + func (pubKey *PubKeySecp256k1) UnmarshalJSON(data []byte) error + func (pubKey *PubKeySecp256k1) VerifyBytes(msg []byte, sig_ Signature) bool + type Signature interface + Bytes func() []byte + Equals func(Signature) bool + IsZero func() bool + String func() string + func SignatureFromBytes(tp byte, sigBytes []byte) (sig Signature, err error) + type SignatureEd25519 [64]byte + func (sig *SignatureEd25519) Bytes() []byte + func (sig *SignatureEd25519) Equals(other Signature) bool + func (sig *SignatureEd25519) IsZero() bool + func (sig *SignatureEd25519) MarshalJSON() ([]byte, error) + func (sig *SignatureEd25519) String() string + func (sig *SignatureEd25519) UnmarshalJSON(data []byte) error + type SignatureSecp256k1 []byte + func (sig *SignatureSecp256k1) Bytes() []byte + func (sig *SignatureSecp256k1) Equals(other Signature) bool + func (sig *SignatureSecp256k1) IsZero() bool + func (sig *SignatureSecp256k1) MarshalJSON() ([]byte, error) + func (sig *SignatureSecp256k1) String() string + func (sig *SignatureSecp256k1) UnmarshalJSON(data []byte) error + type StPrivKey struct + func (p *StPrivKey) String() string + func (p *StPrivKey) UnmarshalJSON(data []byte) error + func (p StPrivKey) MarshalJSON() ([]byte, error) + type StPubKey struct + func (p *StPubKey) String() string + func (p *StPubKey) UnmarshalJSON(data []byte) error + func (p StPubKey) MarshalJSON() ([]byte, error) + type StSignature struct + func (s *StSignature) String() string + func (s *StSignature) UnmarshalJSON(data []byte) error + func (s StSignature) MarshalJSON() ([]byte, error)