mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-06-23 08:21:46 +00:00
Fix test
This commit is contained in:
@ -23,7 +23,9 @@ export function encryptStream(handshake: Handshake, session: NoiseSession) : IRe
|
||||
export function decryptStream(handshake: Handshake, session: NoiseSession) : IReturnEncryptionWrapper {
|
||||
return async function * (source) {
|
||||
for await (const chunk of source) {
|
||||
console.log("Going to decrypt chunk: ", chunk)
|
||||
const decrypted = await handshake.decrypt(chunk, session);
|
||||
console.log("Decrypted: ", decrypted)
|
||||
yield decrypted
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,8 @@ export class Handshake {
|
||||
const receivedMessageBuffer = (await this.connection.readLP()).slice();
|
||||
const plaintext = await this.xx.recvMessage(session, decodeMessageBuffer(receivedMessageBuffer));
|
||||
}
|
||||
|
||||
console.log("FINISHED HANDSHAKE, is initiator: ", this.isInitiator);
|
||||
}
|
||||
|
||||
encrypt(plaintext: bytes, session: NoiseSession): bytes {
|
||||
|
@ -91,8 +91,6 @@ export class Noise implements NoiseConnection {
|
||||
const [secure, user] = DuplexPair();
|
||||
const network = connection.unwrap();
|
||||
|
||||
console.log("Unwrapped network: ", network)
|
||||
|
||||
pipe(
|
||||
secure, // write to wrapper
|
||||
ensureBuffer, // ensure any type of data is converted to buffer
|
||||
|
Reference in New Issue
Block a user