Versions in this module Expand all Collapse all v1 v1.1.21 Jul 5, 2021 Changes in this version + const MaxManualTypeID + var ErrNotSupportAggr = errors.New("AggregateCrypto not support") + var ErrSign = errors.New("error signature") + func BasicValidation(c Crypto, msg, pub, sig []byte) error + func CRandBytes(numBytes int) []byte + func CRandHex(numDigits int) string + func CReader() io.Reader + func GenDriverTypeID(name string) int32 + func GetName(ty int) string + func GetType(name string) int + func Init(cfg *Config, subCfg map[string][]byte) + func IsEnable(name string, height int64) bool + func MixEntropy(seedBytes []byte) + func Register(name string, crypto Crypto, options ...Option) + func Ripemd160(bytes []byte) []byte + func Sha256(bytes []byte) []byte + func Sm3Hash(msg []byte) []byte + type AggregateCrypto interface + Aggregate func(sigs []Signature) (Signature, error) + AggregatePublic func(pubs []PubKey) (PubKey, error) + VerifyAggregatedN func(pubs []PubKey, ms [][]byte, sig Signature) error + VerifyAggregatedOne func(pubs []PubKey, m []byte, sig Signature) error + func ToAggregate(c Crypto) (AggregateCrypto, error) + type CertSignature struct + Cert []byte + Signature []byte + type Config struct + EnableHeight map[string]int64 + EnableTypes []string + type Crypto interface + GenKey func() (PrivKey, error) + PrivKeyFromBytes func([]byte) (PrivKey, error) + PubKeyFromBytes func([]byte) (PubKey, error) + SignatureFromBytes func([]byte) (Signature, error) + Validate func(msg, pub, sig []byte) error + func New(name string) (Crypto, error) + type Driver struct + type DriverInitFunc func(jsonCfg []byte) + type Option func(*Driver) error + func WithOptionCGO() Option + func WithOptionDefaultDisable() Option + func WithOptionInitFunc(fn DriverInitFunc) Option + func WithOptionTypeID(id int32) Option + type PrivKey interface + Bytes func() []byte + Equals func(PrivKey) bool + PubKey func() PubKey + Sign func(msg []byte) Signature + type PubKey interface + Bytes func() []byte + Equals func(PubKey) bool + KeyString func() string + VerifyBytes func(msg []byte, sig Signature) bool + type Signature interface + Bytes func() []byte + Equals func(Signature) bool + IsZero func() bool + String func() string