eddsa.pyi 726 B

123456789101112131415161718192021
  1. from typing import Union, Optional
  2. from typing_extensions import Protocol
  3. from Crypto.PublicKey.ECC import EccKey
  4. class Hash(Protocol):
  5. def digest(self) -> bytes: ...
  6. class XOF(Protocol):
  7. def read(self, len: int) -> bytes: ...
  8. def import_public_key(encoded: bytes) -> EccKey: ...
  9. def import_private_key(encoded: bytes) -> EccKey: ...
  10. class EdDSASigScheme(object):
  11. def __init__(self, key: EccKey, context: bytes) -> None: ...
  12. def can_sign(self) -> bool: ...
  13. def sign(self, msg_or_hash: Union[bytes, Hash, XOF]) -> bytes: ...
  14. def verify(self, msg_or_hash: Union[bytes, Hash, XOF], signature: bytes) -> None: ...
  15. def new(key: EccKey, mode: str, context: Optional[bytes]=None) -> EdDSASigScheme: ...