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