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.

41 lines
712 B

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. package blocks
  2. import (
  3. . "github.com/tendermint/tendermint/binary"
  4. "io"
  5. )
  6. /*
  7. Signature message wire format:
  8. |A...|SSS...|
  9. A account number, varint encoded (1+ bytes)
  10. S signature of all prior bytes (32 bytes)
  11. It usually follows the message to be signed.
  12. */
  13. type Signature struct {
  14. Signer AccountId
  15. SigBytes ByteSlice
  16. }
  17. func ReadSignature(r io.Reader) Signature {
  18. return Signature{
  19. Signer: ReadAccountId(r),
  20. SigBytes: ReadByteSlice(r),
  21. }
  22. }
  23. func (self Signature) WriteTo(w io.Writer) (n int64, err error) {
  24. n, err = WriteOnto(self.Signer, w, n, err)
  25. n, err = WriteOnto(self.SigBytes, w, n, err)
  26. return
  27. }
  28. func (self *Signature) Verify(msg ByteSlice) bool {
  29. return false
  30. }