Documentation ¶
Index ¶
- Constants
- func Generate(sigType crypto.SigType) ([]byte, error)
- func GenerateFromSeed(sigType crypto.SigType, seed io.Reader) ([]byte, error)
- func RegisterSignature(typ crypto.SigType, vs SigShim)
- func Sign(msg []byte, privkey []byte, sigType SigType) (*crypto.Signature, error)
- func ToPublic(sigType crypto.SigType, pk []byte) ([]byte, error)
- func Verify(sig *crypto.Signature, addr address.Address, msg []byte) error
- func VerifyAggregate(pubKeys, msgs [][]byte, signature []byte) error
- type SigShim
- type SigType
- type Signature
Constants ¶
View Source
const ( SigTypeUnknown = crypto.SigTypeUnknown SigTypeSecp256k1 = crypto.SigTypeSecp256k1 SigTypeBLS = crypto.SigTypeBLS SigTypeDelegated = crypto.SigTypeDelegated )
View Source
const (
BLSSignatureBytes = 96
)
Variables ¶
This section is empty.
Functions ¶
func GenerateFromSeed ¶ added in v1.10.0
GenerateFromSeed generates private key of given type and seed
func RegisterSignature ¶ added in v1.0.1
RegisterSignature should be only used during init
func Sign ¶
Sign takes in signature type, private key and message. Returns a signature for that message. Valid sigTypes are: "secp256k1" and "bls"
func VerifyAggregate ¶ added in v1.0.1
Types ¶
type SigShim ¶ added in v1.0.1
type SigShim interface { GenPrivate() ([]byte, error) GenPrivateFromSeed(seed io.Reader) ([]byte, error) ToPublic(pk []byte) ([]byte, error) Sign(pk []byte, msg []byte) ([]byte, error) Verify(sig []byte, a address.Address, msg []byte) error VerifyAggregate(pubKeys, msgs [][]byte, signature []byte) bool }
SigShim is used for introducing signature functions
Click to show internal directories.
Click to hide internal directories.