Versions in this module Expand all Collapse all v0 v0.1.0 Apr 19, 2020 Changes in this version + const SECP256K1RPKLen + const SECP256K1RSKLen + const SECP256K1RSigLen + var EnableCrypto = true + func IsSortedAndUniqueSECP2561RSigs(sigs [][SECP256K1RSigLen]byte) bool + func SortSECP2561RSigs(lst [][SECP256K1RSigLen]byte) + type Factory interface + NewPrivateKey func() (PrivateKey, error) + ToPrivateKey func([]byte) (PrivateKey, error) + ToPublicKey func([]byte) (PublicKey, error) + type FactoryED25519 struct + func (*FactoryED25519) NewPrivateKey() (PrivateKey, error) + func (*FactoryED25519) ToPrivateKey(b []byte) (PrivateKey, error) + func (*FactoryED25519) ToPublicKey(b []byte) (PublicKey, error) + type FactoryRSA struct + func (*FactoryRSA) NewPrivateKey() (PrivateKey, error) + func (*FactoryRSA) ToPrivateKey(b []byte) (PrivateKey, error) + func (*FactoryRSA) ToPublicKey(b []byte) (PublicKey, error) + type FactoryRSAPSS struct + func (*FactoryRSAPSS) NewPrivateKey() (PrivateKey, error) + func (*FactoryRSAPSS) ToPrivateKey(b []byte) (PrivateKey, error) + func (*FactoryRSAPSS) ToPublicKey(b []byte) (PublicKey, error) + type FactorySECP256K1R struct + Cache cache.LRU + func (*FactorySECP256K1R) NewPrivateKey() (PrivateKey, error) + func (*FactorySECP256K1R) ToPrivateKey(b []byte) (PrivateKey, error) + func (*FactorySECP256K1R) ToPublicKey(b []byte) (PublicKey, error) + func (f *FactorySECP256K1R) RecoverHashPublicKey(hash, sig []byte) (PublicKey, error) + func (f *FactorySECP256K1R) RecoverPublicKey(msg, sig []byte) (PublicKey, error) + type PrivateKey interface + Bytes func() []byte + PublicKey func() PublicKey + Sign func(message []byte) ([]byte, error) + SignHash func(hash []byte) ([]byte, error) + type PrivateKeyED25519 struct + func (k *PrivateKeyED25519) PublicKey() PublicKey + func (k *PrivateKeyED25519) Sign(msg []byte) ([]byte, error) + func (k PrivateKeyED25519) Bytes() []byte + func (k PrivateKeyED25519) SignHash(hash []byte) ([]byte, error) + type PrivateKeyRSA struct + func (k *PrivateKeyRSA) Bytes() []byte + func (k *PrivateKeyRSA) PublicKey() PublicKey + func (k *PrivateKeyRSA) Sign(msg []byte) ([]byte, error) + func (k *PrivateKeyRSA) SignHash(hash []byte) ([]byte, error) + type PrivateKeyRSAPSS struct + func (k *PrivateKeyRSAPSS) Bytes() []byte + func (k *PrivateKeyRSAPSS) PublicKey() PublicKey + func (k *PrivateKeyRSAPSS) Sign(msg []byte) ([]byte, error) + func (k *PrivateKeyRSAPSS) SignHash(hash []byte) ([]byte, error) + type PrivateKeySECP256K1R struct + func (k *PrivateKeySECP256K1R) Bytes() []byte + func (k *PrivateKeySECP256K1R) PublicKey() PublicKey + func (k *PrivateKeySECP256K1R) Sign(msg []byte) ([]byte, error) + func (k *PrivateKeySECP256K1R) SignHash(hash []byte) ([]byte, error) + type PublicKey interface + Address func() ids.ShortID + Bytes func() []byte + Verify func(message, signature []byte) bool + VerifyHash func(hash, signature []byte) bool + type PublicKeyED25519 struct + func (k *PublicKeyED25519) Address() ids.ShortID + func (k *PublicKeyED25519) Bytes() []byte + func (k *PublicKeyED25519) Verify(msg, sig []byte) bool + func (k *PublicKeyED25519) VerifyHash(hash, sig []byte) bool + type PublicKeyRSA struct + func (k *PublicKeyRSA) Address() ids.ShortID + func (k *PublicKeyRSA) Bytes() []byte + func (k *PublicKeyRSA) Verify(msg, sig []byte) bool + func (k *PublicKeyRSA) VerifyHash(hash, sig []byte) bool + type PublicKeyRSAPSS struct + func (k *PublicKeyRSAPSS) Address() ids.ShortID + func (k *PublicKeyRSAPSS) Bytes() []byte + func (k *PublicKeyRSAPSS) Verify(msg, sig []byte) bool + func (k *PublicKeyRSAPSS) VerifyHash(hash, sig []byte) bool + type PublicKeySECP256K1R struct + func (k *PublicKeySECP256K1R) Address() ids.ShortID + func (k *PublicKeySECP256K1R) Bytes() []byte + func (k *PublicKeySECP256K1R) Verify(msg, sig []byte) bool + func (k *PublicKeySECP256K1R) VerifyHash(hash, sig []byte) bool + type RecoverableFactory interface + RecoverHashPublicKey func(hash, signature []byte) (PublicKey, error) + RecoverPublicKey func(message, signature []byte) (PublicKey, error)