Versions in this module Expand all Collapse all v0 v0.0.1 Feb 7, 2021 Changes in this version + const NameEd25519 + const NameSecp256k1 + const TypeEd25519 + const TypeSecp256k1 + const Version + var PrivKeyMapper = data.NewMapper(PrivKey{}) + var PubKeyMapper = data.NewMapper(PubKey{}) + var SignatureMapper = data.NewMapper(Signature{}) + 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 struct + func PrivKeyFromBytes(privKeyBytes []byte) (privKey PrivKey, err error) + func (h *PrivKey) UnmarshalJSON(data []byte) (err error) + func (h PrivKey) Empty() bool + func (h PrivKey) MarshalJSON() ([]byte, error) + func (h PrivKey) Unwrap() PrivKeyInner + type PrivKeyEd25519 [64]byte + func GenPrivKeyEd25519() PrivKeyEd25519 + func GenPrivKeyEd25519FromSecret(secret []byte) PrivKeyEd25519 + func (hi PrivKeyEd25519) Wrap() PrivKey + func (p *PrivKeyEd25519) UnmarshalJSON(enc []byte) error + func (p PrivKeyEd25519) MarshalJSON() ([]byte, error) + func (privKey PrivKeyEd25519) AssertIsPrivKeyInner() + func (privKey PrivKeyEd25519) Bytes() []byte + func (privKey PrivKeyEd25519) Equals(other PrivKey) bool + func (privKey PrivKeyEd25519) Generate(index int) PrivKeyEd25519 + func (privKey PrivKeyEd25519) PubKey() PubKey + func (privKey PrivKeyEd25519) Sign(msg []byte) Signature + func (privKey PrivKeyEd25519) String() string + func (privKey PrivKeyEd25519) ToCurve25519() *[32]byte + type PrivKeyInner interface + AssertIsPrivKeyInner func() + Bytes func() []byte + Equals func(PrivKey) bool + PubKey func() PubKey + Sign func(msg []byte) Signature + Wrap func() PrivKey + type PrivKeySecp256k1 [32]byte + func GenPrivKeySecp256k1() PrivKeySecp256k1 + func GenPrivKeySecp256k1FromSecret(secret []byte) PrivKeySecp256k1 + func (hi PrivKeySecp256k1) Wrap() PrivKey + func (p *PrivKeySecp256k1) UnmarshalJSON(enc []byte) error + func (p PrivKeySecp256k1) MarshalJSON() ([]byte, error) + func (privKey PrivKeySecp256k1) AssertIsPrivKeyInner() + func (privKey PrivKeySecp256k1) Bytes() []byte + func (privKey PrivKeySecp256k1) Equals(other PrivKey) bool + func (privKey PrivKeySecp256k1) PubKey() PubKey + func (privKey PrivKeySecp256k1) Sign(msg []byte) Signature + func (privKey PrivKeySecp256k1) String() string + type PubKey struct + func PubKeyFromBytes(pubKeyBytes []byte) (pubKey PubKey, err error) + func (h *PubKey) UnmarshalJSON(data []byte) (err error) + func (h PubKey) Empty() bool + func (h PubKey) MarshalJSON() ([]byte, error) + func (h PubKey) Unwrap() PubKeyInner + type PubKeyEd25519 [32]byte + func (hi PubKeyEd25519) Wrap() PubKey + func (p *PubKeyEd25519) UnmarshalJSON(enc []byte) error + func (p PubKeyEd25519) MarshalJSON() ([]byte, error) + func (pubKey PubKeyEd25519) Address() []byte + func (pubKey PubKeyEd25519) AssertIsPubKeyInner() + func (pubKey PubKeyEd25519) Bytes() []byte + func (pubKey PubKeyEd25519) Equals(other PubKey) bool + func (pubKey PubKeyEd25519) KeyString() string + func (pubKey PubKeyEd25519) String() string + func (pubKey PubKeyEd25519) ToCurve25519() *[32]byte + func (pubKey PubKeyEd25519) VerifyBytes(msg []byte, sig_ Signature) bool + type PubKeyInner interface + Address func() []byte + AssertIsPubKeyInner func() + Bytes func() []byte + Equals func(PubKey) bool + KeyString func() string + VerifyBytes func(msg []byte, sig Signature) bool + Wrap func() PubKey + type PubKeySecp256k1 [33]byte + func (hi PubKeySecp256k1) Wrap() PubKey + func (p *PubKeySecp256k1) UnmarshalJSON(enc []byte) error + func (p PubKeySecp256k1) MarshalJSON() ([]byte, error) + func (pubKey PubKeySecp256k1) Address() []byte + func (pubKey PubKeySecp256k1) AssertIsPubKeyInner() + func (pubKey PubKeySecp256k1) Bytes() []byte + func (pubKey PubKeySecp256k1) Equals(other PubKey) bool + func (pubKey PubKeySecp256k1) KeyString() string + func (pubKey PubKeySecp256k1) String() string + func (pubKey PubKeySecp256k1) VerifyBytes(msg []byte, sig_ Signature) bool + type Signature struct + func SignatureEd25519FromBytes(data []byte) Signature + func SignatureFromBytes(sigBytes []byte) (sig Signature, err error) + func (h *Signature) UnmarshalJSON(data []byte) (err error) + func (h Signature) Empty() bool + func (h Signature) MarshalJSON() ([]byte, error) + func (h Signature) Unwrap() SignatureInner + type SignatureEd25519 [64]byte + func (hi SignatureEd25519) Wrap() Signature + func (sig *SignatureEd25519) UnmarshalJSON(enc []byte) error + func (sig SignatureEd25519) AssertIsSignatureInner() + 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 + type SignatureInner interface + AssertIsSignatureInner func() + Bytes func() []byte + Equals func(Signature) bool + IsZero func() bool + Wrap func() Signature + type SignatureSecp256k1 []byte + func (hi SignatureSecp256k1) Wrap() Signature + func (sig *SignatureSecp256k1) UnmarshalJSON(enc []byte) error + func (sig SignatureSecp256k1) AssertIsSignatureInner() + 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