base.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. from eth_keys.datatypes import (
  2. BaseSignature,
  3. NonRecoverableSignature,
  4. PrivateKey,
  5. PublicKey,
  6. Signature,
  7. )
  8. class BaseECCBackend:
  9. def ecdsa_sign(self, msg_hash: bytes, private_key: PrivateKey) -> Signature:
  10. raise NotImplementedError()
  11. def ecdsa_sign_non_recoverable(
  12. self, msg_hash: bytes, private_key: PrivateKey
  13. ) -> NonRecoverableSignature:
  14. raise NotImplementedError()
  15. def ecdsa_verify(
  16. self, msg_hash: bytes, signature: BaseSignature, public_key: PublicKey
  17. ) -> bool:
  18. raise NotImplementedError()
  19. def ecdsa_recover(self, msg_hash: bytes, signature: Signature) -> PublicKey:
  20. raise NotImplementedError()
  21. def private_key_to_public_key(self, private_key: PrivateKey) -> PublicKey:
  22. raise NotImplementedError()
  23. def decompress_public_key_bytes(self, compressed_public_key_bytes: bytes) -> bytes:
  24. raise NotImplementedError()
  25. def compress_public_key_bytes(self, uncompressed_public_key_bytes: bytes) -> bytes:
  26. raise NotImplementedError()