1
0
mirror of https://github.com/fluencelabs/js-libp2p-noise synced 2025-05-28 20:11:30 +00:00
js-libp2p-noise/src/@types/handshake-interface.ts

11 lines
331 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;
encrypt(plaintext: bytes, session: NoiseSession): bytes;
2020-03-01 19:05:53 +01:00
decrypt(ciphertext: bytes, session: NoiseSession): {plaintext: bytes; valid: boolean};
}