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