earthsnake/mypy-stubs/ed25519/keys.pyi

33 lines
1.4 KiB
Python

from typing import Any, Callable, Optional, Tuple
BadSignatureError: Any
def create_keypair(entropy: Callable[[int], bytes] = ...) -> Tuple[SigningKey, VerifyingKey]: ...
class BadPrefixError(Exception): ...
def remove_prefix(s_bytes: bytes, prefix: bytes) -> bytes: ...
def to_ascii(s_bytes: bytes, prefix: str = ..., encoding: str = ...) -> str: ...
def from_ascii(s_ascii: str, prefix: str = ..., encoding: str = ...) -> bytes: ...
class SigningKey:
sk_s: bytes
vk_s: bytes
def __init__(self, sk_s: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> None: ...
def to_bytes(self, prefix: str = ...) -> bytes: ...
def to_ascii(self, prefix: str = ..., encoding: Optional[str] = ...) -> str: ...
def to_seed(self, prefix: str = ...) -> bytes: ...
def __eq__(self, them: object) -> bool: ...
def get_verifying_key(self) -> VerifyingKey: ...
def sign(self, msg: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> bytes: ...
class VerifyingKey:
vk_s: bytes
def __init__(self, vk_s: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> None: ...
def to_bytes(self, prefix: str = ...) -> bytes: ...
def to_ascii(self, prefix: str = ..., encoding: Optional[str] = ...) -> str: ...
def __eq__(self, them: object) -> bool: ...
def verify(self, sig: bytes, msg: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> bool: ...
def selftest() -> None: ...