1
0
mirror of https://github.com/fluencelabs/js-libp2p-noise synced 2025-05-09 08:02:33 +00:00
js-libp2p-noise/src/@types/handshake-interface.ts

12 lines
352 B
TypeScript
Raw Normal View History

import {bytes} from "./basic";
import {NoiseSession} from "./handshake";
2020-02-07 20:21:27 +01:00
import PeerId from "peer-id";
2020-01-07 13:34:45 +01:00
export interface IHandshake {
session: NoiseSession;
2020-02-07 20:21:27 +01:00
remotePeer: PeerId;
2020-04-17 10:56:31 +02:00
earlyData: Buffer;
encrypt(plaintext: bytes, session: NoiseSession): bytes;
2020-03-01 19:05:53 +01:00
decrypt(ciphertext: bytes, session: NoiseSession): {plaintext: bytes; valid: boolean};
}