1
0

trivial clean-up (typing/imports)

This commit is contained in:
SomberNight
2020-02-28 20:27:35 +01:00
parent 02fcc6f570
commit a32af44ff9
5 changed files with 9 additions and 10 deletions

View File

@@ -26,8 +26,8 @@
import hashlib
from typing import Sequence, List, Tuple, NamedTuple, TYPE_CHECKING
from enum import IntEnum, IntFlag
from Cryptodome.Cipher import ChaCha20
from Cryptodome.Cipher import ChaCha20
from . import ecc
from .crypto import sha256, hmac_oneshot
@@ -231,9 +231,10 @@ def generate_cipher_stream(stream_key: bytes, num_bytes: int) -> bytes:
return cipher.encrypt(bytes(num_bytes))
ProcessedOnionPacket = NamedTuple("ProcessedOnionPacket", [("are_we_final", bool),
("hop_data", OnionHopsDataSingle),
("next_packet", OnionPacket)])
class ProcessedOnionPacket(NamedTuple):
are_we_final: bool
hop_data: OnionHopsDataSingle
next_packet: OnionPacket
# TODO replay protection