Documentation ¶
Index ¶
- type Algorithm
- type AlgorithmBackend
- type Signature
- func (s *Signature) Decode(b []byte) error
- func (s *Signature) Encode() ([]byte, error)
- func (s *Signature) Equal(sig *Signature) bool
- func (s *Signature) FromPb(sr *sigpb.Signature) *Signature
- func (s *Signature) Hash() []byte
- func (s *Signature) SetPubkey(pubkey []byte)
- func (s *Signature) ToBytes() []byte
- func (s *Signature) ToPb() *sigpb.Signature
- func (s *Signature) Verify(info []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm uint8
Algorithm is the crypto algorithm of signature
const ( Secp256k1 Algorithm Ed25519 )
Algorithm list
func NewAlgorithm ¶ added in v1.1.0
NewAlgorithm returns a new algorithm by name
type AlgorithmBackend ¶
type AlgorithmBackend interface { Sign(message []byte, seckey []byte) []byte Verify(message []byte, pubkey []byte, sig []byte) bool GetPubkey(seckey []byte) []byte GenSeckey() []byte }
AlgorithmBackend is the interface of algorithm backend
type Signature ¶
Signature is the signature of some message
func NewSignature ¶
NewSignature returns new signature
Click to show internal directories.
Click to hide internal directories.