Files
trezor-firmware/python/stubs/noise/connection.pyi
matejcik 6e3018509b refactor(python): rework session-based API
Co-authored-by: M1nd3r <petrsedlacek.km@seznam.cz>
Co-authored-by: Roman Zeyde <roman.zeyde@satoshilabs.com>

[no changelog]
2026-02-03 14:47:31 +01:00

30 lines
839 B
Python

from enum import Enum, auto
import typing as t
import typing_extensions as tx
from .noise_protocol import NoiseProtocol
T = t.TypeVar("T")
class NoiseConnection:
noise_protocol: NoiseProtocol
@classmethod
def from_name(cls, name: bytes) -> tx.Self: ...
def set_as_initiator(self) -> None: ...
def set_keypair_from_private_bytes(self, keypair: Keypair, private_bytes: bytes) -> None: ...
def set_prologue(self, prologue: bytes) -> None: ...
def start_handshake(self) -> None: ...
def write_message(self, payload: bytes) -> bytes: ...
def read_message(self, payload: bytes) -> bytes: ...
def get_handshake_hash(self) -> bytes: ...
def decrypt(self, data: bytes) -> bytes: ...
def encrypt(self, data: bytes) -> bytes: ...
class Keypair(Enum):
EPHEMERAL = auto()
STATIC = auto()