Versions in this module Expand all Collapse all v1 v1.0.1 Sep 10, 2023 v1.0.0 Jul 24, 2023 Changes in this version + const NameBls + const NameEd25519 + const NameEthereum + const NameSecp256k1 + const TypeBls + const TypeEd25519 + const TypeEthereum + const TypeSecp256k1 + func CRandBytes(numBytes int) []byte + func CRandHex(numDigits int) string + func CReader() io.Reader + func CheckConsensusPubKey(from common.Address, consensusPubkey, signature []byte) error + 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 BLSPrivKey [32]byte + func (privKey *BLSPrivKey) UnmarshalJSON(enc []byte) error + func (privKey BLSPrivKey) Bytes() []byte + func (privKey BLSPrivKey) Equals(other PrivKey) bool + func (privKey BLSPrivKey) MarshalJSON() ([]byte, error) + func (privKey BLSPrivKey) PubKey() PubKey + func (privKey BLSPrivKey) Sign(msg []byte) Signature + type BLSPubKey [128]byte + func BLSPubKeyAggregate(pks []*PubKey) *BLSPubKey + func (pubKey *BLSPubKey) UnmarshalJSON(enc []byte) error + func (pubKey BLSPubKey) Address() []byte + func (pubKey BLSPubKey) Bytes() []byte + func (pubKey BLSPubKey) Equals(other PubKey) bool + func (pubKey BLSPubKey) KeyString() string + func (pubKey BLSPubKey) MarshalJSON() ([]byte, error) + func (pubKey BLSPubKey) VerifyBytes(msg []byte, sig_ Signature) bool + type BLSSignature []byte + func BLSSignatureAggregate(sigs []*Signature) BLSSignature + func (p *BLSSignature) UnmarshalJSON(enc []byte) error + func (p BLSSignature) MarshalJSON() ([]byte, error) + func (sig BLSSignature) Bytes() []byte + func (sig BLSSignature) Equals(other Signature) bool + func (sig BLSSignature) IsZero() bool + func (sig BLSSignature) String() string + type EthereumPrivKey []byte + func (privKey *EthereumPrivKey) UnmarshalJSON(enc []byte) error + func (privKey EthereumPrivKey) Bytes() []byte + func (privKey EthereumPrivKey) Equals(other PrivKey) bool + func (privKey EthereumPrivKey) MarshalJSON() ([]byte, error) + func (privKey EthereumPrivKey) PubKey() PubKey + func (privKey EthereumPrivKey) Sign(msg []byte) Signature + type EthereumPubKey []byte + func (p *EthereumPubKey) UnmarshalJSON(enc []byte) error + func (pubKey EthereumPubKey) Address() []byte + func (pubKey EthereumPubKey) Bytes() []byte + func (pubKey EthereumPubKey) Equals(other PubKey) bool + func (pubKey EthereumPubKey) KeyString() string + func (pubKey EthereumPubKey) MarshalJSON() ([]byte, error) + func (pubKey EthereumPubKey) VerifyBytes(msg []byte, sig_ Signature) bool + type EthereumSignature []byte + func (sig *EthereumSignature) UnmarshalJSON(enc []byte) error + func (sig EthereumSignature) Bytes() []byte + func (sig EthereumSignature) Equals(other Signature) bool + func (sig EthereumSignature) IsZero() bool + func (sig EthereumSignature) MarshalJSON() ([]byte, error) + func (sig EthereumSignature) SigByte() []byte + func (sig EthereumSignature) String() string + type PrivKey interface + Bytes func() []byte + Equals func(PrivKey) bool + PubKey func() PubKey + Sign func(msg []byte) Signature + func PrivKeyFromBytes(privKeyBytes []byte) (privKey PrivKey, err error) + type PrivKeyEd25519 [64]byte + func GenPrivKeyEd25519() PrivKeyEd25519 + func GenPrivKeyEd25519FromSecret(secret []byte) PrivKeyEd25519 + func (p *PrivKeyEd25519) UnmarshalJSON(enc []byte) error + func (p PrivKeyEd25519) MarshalJSON() ([]byte, error) + 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 PrivKeyS struct + func WrapPrivKey(pk PrivKey) PrivKeyS + func (p *PrivKeyS) UnmarshalJSON(data []byte) (err error) + func (p PrivKeyS) Empty() bool + func (p PrivKeyS) MarshalJSON() ([]byte, error) + type PrivKeySecp256k1 [32]byte + func GenPrivKeySecp256k1() PrivKeySecp256k1 + func GenPrivKeySecp256k1FromSecret(secret []byte) PrivKeySecp256k1 + func (p *PrivKeySecp256k1) UnmarshalJSON(enc []byte) error + func (p PrivKeySecp256k1) MarshalJSON() ([]byte, error) + 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 interface + Address func() []byte + Bytes func() []byte + Equals func(PubKey) bool + KeyString func() string + VerifyBytes func(msg []byte, sig Signature) bool + func PubKeyFromBytes(pubKeyBytes []byte) (pubKey PubKey, err error) + type PubKeyEd25519 [32]byte + func (p *PubKeyEd25519) UnmarshalJSON(enc []byte) error + func (p PubKeyEd25519) MarshalJSON() ([]byte, error) + 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) String() string + func (pubKey PubKeyEd25519) ToCurve25519() *[32]byte + func (pubKey PubKeyEd25519) VerifyBytes(msg []byte, sig_ Signature) bool + type PubKeyS struct + func WrapPubKey(pk PubKey) PubKeyS + func (p *PubKeyS) UnmarshalJSON(data []byte) (err error) + func (p PubKeyS) Empty() bool + func (p PubKeyS) MarshalJSON() ([]byte, error) + type PubKeySecp256k1 [33]byte + func (p *PubKeySecp256k1) UnmarshalJSON(enc []byte) error + func (p PubKeySecp256k1) MarshalJSON() ([]byte, error) + 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) String() string + 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(sigBytes []byte) (sig Signature, err error) + type SignatureEd25519 [64]byte + func (p *SignatureEd25519) UnmarshalJSON(enc []byte) error + func (p SignatureEd25519) MarshalJSON() ([]byte, error) + func (sig SignatureEd25519) Bytes() []byte + func (sig SignatureEd25519) Equals(other Signature) bool + func (sig SignatureEd25519) IsZero() bool + func (sig SignatureEd25519) String() string + type SignatureS struct + func WrapSignature(sig Signature) SignatureS + func (p *SignatureS) UnmarshalJSON(data []byte) (err error) + func (p SignatureS) Empty() bool + func (p SignatureS) MarshalJSON() ([]byte, error) + type SignatureSecp256k1 []byte + func (p *SignatureSecp256k1) UnmarshalJSON(enc []byte) error + func (p SignatureSecp256k1) MarshalJSON() ([]byte, error) + func (sig SignatureSecp256k1) Bytes() []byte + func (sig SignatureSecp256k1) Equals(other Signature) bool + func (sig SignatureSecp256k1) IsZero() bool + func (sig SignatureSecp256k1) String() string