mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 07:30:55 +00:00
Refactor
This commit is contained in:
@ -19,7 +19,7 @@ from libp2p.crypto.key_exchange import create_ephemeral_key_pair
|
||||
from libp2p.crypto.keys import PrivateKey, PublicKey
|
||||
from libp2p.crypto.serialization import deserialize_public_key
|
||||
from libp2p.io.exceptions import DecryptionFailedException, IOException
|
||||
from libp2p.io.msgio import MsgIOReadWriter
|
||||
from libp2p.io.msgio import BaseMsgReadWriter
|
||||
from libp2p.network.connection.raw_connection_interface import IRawConnection
|
||||
from libp2p.peer.id import ID as PeerID
|
||||
from libp2p.security.base_session import BaseSession
|
||||
@ -41,6 +41,7 @@ from .pb.spipe_pb2 import Exchange, Propose
|
||||
ID = TProtocol("/secio/1.0.0")
|
||||
|
||||
NONCE_SIZE = 16 # bytes
|
||||
SIZE_SECIO_LEN_BYTES = 4
|
||||
|
||||
# NOTE: the following is only a subset of allowable parameters according to the
|
||||
# `secio` specification.
|
||||
@ -49,6 +50,10 @@ DEFAULT_SUPPORTED_CIPHERS = "AES-128"
|
||||
DEFAULT_SUPPORTED_HASHES = "SHA256"
|
||||
|
||||
|
||||
class MsgIOReadWriter(BaseMsgReadWriter):
|
||||
size_len_bytes = SIZE_SECIO_LEN_BYTES
|
||||
|
||||
|
||||
class SecureSession(BaseSession):
|
||||
buf: io.BytesIO
|
||||
low_watermark: int
|
||||
|
||||
Reference in New Issue
Block a user