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.

30 lines
717 B

  1. package sr25519
  2. import (
  3. amino "github.com/tendermint/go-amino"
  4. "github.com/tendermint/tendermint/crypto"
  5. )
  6. var _ crypto.PrivKey = PrivKeySr25519{}
  7. const (
  8. PrivKeyAminoName = "tendermint/PrivKeySr25519"
  9. PubKeyAminoName = "tendermint/PubKeySr25519"
  10. // SignatureSize is the size of an Edwards25519 signature. Namely the size of a compressed
  11. // Sr25519 point, and a field element. Both of which are 32 bytes.
  12. SignatureSize = 64
  13. )
  14. var cdc = amino.NewCodec()
  15. func init() {
  16. cdc.RegisterInterface((*crypto.PubKey)(nil), nil)
  17. cdc.RegisterConcrete(PubKeySr25519{},
  18. PubKeyAminoName, nil)
  19. cdc.RegisterInterface((*crypto.PrivKey)(nil), nil)
  20. cdc.RegisterConcrete(PrivKeySr25519{},
  21. PrivKeyAminoName, nil)
  22. }