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.

36 lines
1.0 KiB

  1. package crypto
  2. import (
  3. "github.com/tendermint/go-wire"
  4. )
  5. var cdc = wire.NewCodec()
  6. func init() {
  7. // NOTE: It's important that there be no conflicts here,
  8. // as that would change the canonical representations,
  9. // and therefore change the address.
  10. // TODO: Add feature to go-wire to ensure that there
  11. // are no conflicts.
  12. RegisterWire(cdc)
  13. }
  14. func RegisterWire(cdc *wire.Codec) {
  15. cdc.RegisterInterface((*PubKey)(nil), nil)
  16. cdc.RegisterConcrete(PubKeyEd25519{},
  17. "com.tendermint.wire.PubKeyEd25519", nil)
  18. cdc.RegisterConcrete(PubKeySecp256k1{},
  19. "com.tendermint.wire.PubKeySecp256k1", nil)
  20. cdc.RegisterInterface((*PrivKey)(nil), nil)
  21. cdc.RegisterConcrete(PrivKeyEd25519{},
  22. "com.tendermint.wire.PrivKeyEd25519", nil)
  23. cdc.RegisterConcrete(PrivKeySecp256k1{},
  24. "com.tendermint.wire.PrivKeySecp256k1", nil)
  25. cdc.RegisterInterface((*Signature)(nil), nil)
  26. cdc.RegisterConcrete(SignatureEd25519{},
  27. "com.tendermint.wire.SignatureKeyEd25519", nil)
  28. cdc.RegisterConcrete(SignatureSecp256k1{},
  29. "com.tendermint.wire.SignatureKeySecp256k1", nil)
  30. }