from typing import Any

class Crypto:
    magic: bytes
    magic_aes: bytes
    def __init__(self) -> None: ...
    def get_key_id(self) -> bytes: ...
    def get_aes_key_id(self) -> bytes: ...

class Server(Crypto):
    host: str
    port: int
    ed25519_public: Any
    x25519_public: Any
    def __init__(self, host: str, port: int, pub_key: bytes) -> None: ...

class Client(Crypto):
    ed25519_private: Any
    ed25519_public: Any
    x25519_private: Any
    x25519_public: Any
    def __init__(self, ed25519_private_key: bytes) -> None: ...
    @staticmethod
    def generate_ed25519_private_key() -> bytes: ...
    def sign(self, message: bytes) -> bytes: ...

class AdnlChannel:
    enc_key: bytes
    dec_key: bytes
    client_aes_key_id: bytes
    server_aes_key_id: bytes
    def __init__(self, client: Client, server: Server, local_id: bytes, peer_id: bytes) -> None: ...
    def encrypt(self, data: bytes) -> bytes: ...
    def decrypt(self, encrypted_data: bytes, checksum: bytes) -> bytes: ...

def aes_ctr_decrypt(cipher: Any, data: bytes) -> bytes: ...
def aes_ctr_encrypt(cipher: Any, data: bytes) -> bytes: ...
def create_aes_ctr_cipher(key: bytes, iv: bytes) -> Any: ...
def create_aes_ctr_sipher_from_key_n_data(key: bytes, data: bytes) -> Any: ...
def get_key_aes_id(key: bytes) -> bytes: ...
def get_random(bytes_size: int) -> bytes: ...
def get_shared_key(private_key: bytes, public_key: bytes) -> bytes: ...
def get_signature(private_key: Any, message: bytes) -> bytes: ...
