Noise: encrypt and decrypt in NoiseConnection

TODO: Add a buffer to read only `n` bytes in `read(n)`
This commit is contained in:
mhchia
2020-02-17 16:30:44 +08:00
parent 6ea96e9313
commit f8739268e2
3 changed files with 34 additions and 7 deletions

View File

@ -113,6 +113,7 @@ class PatternXX(BasePattern):
remote_peer_id_from_pubkey,
conn,
False,
noise_state,
)
async def handshake_outbound(
@ -162,5 +163,5 @@ class PatternXX(BasePattern):
)
return NoiseConnection(
self.local_peer, self.libp2p_privkey, remote_peer, conn, False
self.local_peer, self.libp2p_privkey, remote_peer, conn, False, noise_state
)