from typing import Any, Optional

from Crypto.PublicKey.pubkey import pubkey
from Crypto.PublicKey.pubkey import *  # noqa: F403

class error(Exception): ...

def generate(bits, randfunc, progress_func: Optional[Any] = ...): ...
def construct(tup): ...

class ElGamalobj(pubkey):
    keydata = ...  # type: Any
    def encrypt(self, plaintext, K): ...
    def decrypt(self, ciphertext): ...
    def sign(self, M, K): ...
    def verify(self, M, signature): ...
    def size(self): ...
    def has_private(self): ...
    def publickey(self): ...
