Documentation ¶
Overview ¶
Package sigs allows for signing, verifying signatures and key generation using key types selected by package user.
For support of secp256k1 import: _ "github.com/EpiK-Protocol/go-epik/lib/sigs/secp"
For support of Filecoin BLS import: _ "github.com/EpiK-Protocol/go-epik/lib/sigs/bls"
Index ¶
- func CheckBlockSignature(ctx context.Context, blk *types.BlockHeader, worker address.Address) error
- func Generate(sigType crypto.SigType) ([]byte, error)
- func GenerateFromSeed(sigType crypto.SigType, seed []byte) ([]byte, error)
- func RegisterSignature(typ crypto.SigType, vs SigShim)
- func Sign(sigType crypto.SigType, privkey []byte, msg []byte) (*crypto.Signature, error)
- func ToPublic(sigType crypto.SigType, pk []byte) ([]byte, error)
- func Verify(sig *crypto.Signature, addr address.Address, msg []byte) error
- type SigShim
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckBlockSignature ¶
func CheckBlockSignature(ctx context.Context, blk *types.BlockHeader, worker address.Address) error
func RegisterSignature ¶
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"
Types ¶
type SigShim ¶
type SigShim interface { GenPrivate() ([]byte, error) GenPrivateFromSeed(seed []byte) ([]byte, error) ToPublic(pk []byte) ([]byte, error) Sign(pk []byte, msg []byte) ([]byte, error) Verify(sig []byte, a address.Address, msg []byte) error }
SigShim is used for introducing signature functions
Click to show internal directories.
Click to hide internal directories.