mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-05-12 05:27:15 +00:00
20 lines
532 B
TypeScript
20 lines
532 B
TypeScript
import { expect } from "chai";
|
|
import { Buffer } from 'buffer';
|
|
|
|
import { XXHandshake, KeyPair } from "../src/xx";
|
|
|
|
describe("Index", () => {
|
|
const prologue = Buffer.from("/noise", "utf-8");
|
|
|
|
it("Test creating new XX session", async () => {
|
|
const xx = new XXHandshake();
|
|
|
|
const kpInitiator: KeyPair = await xx.generateKeypair();
|
|
const kpResponder: KeyPair = await xx.generateKeypair();
|
|
|
|
|
|
const session = await xx.initSession(true, prologue, kpInitiator, kpResponder.publicKey);
|
|
console.log(session)
|
|
})
|
|
});
|