mirror of
https://github.com/trezor/trezor-firmware.git
synced 2026-03-03 14:06:40 +01:00
Co-authored-by: M1nd3r <petrsedlacek.km@seznam.cz> Co-authored-by: Roman Zeyde <roman.zeyde@satoshilabs.com> [no changelog]
30 lines
839 B
Python
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()
|