You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
712 B

9 years ago
9 years ago
  1. package crypto
  2. import (
  3. "fmt"
  4. . "github.com/tendermint/go-common"
  5. "github.com/tendermint/go-wire"
  6. )
  7. // Signature is a part of Txs and consensus Votes.
  8. type Signature interface {
  9. IsZero() bool
  10. String() string
  11. }
  12. // Types of Signature implementations
  13. const (
  14. SignatureTypeEd25519 = byte(0x01)
  15. )
  16. // for wire.readReflect
  17. var _ = wire.RegisterInterface(
  18. struct{ Signature }{},
  19. wire.ConcreteType{SignatureEd25519{}, SignatureTypeEd25519},
  20. )
  21. //-------------------------------------
  22. // Implements Signature
  23. type SignatureEd25519 [64]byte
  24. func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 }
  25. func (sig SignatureEd25519) String() string { return fmt.Sprintf("/%X.../", Fingerprint(sig[:])) }