Create handshakes dir

This commit is contained in:
Belma Gutlic 2019-12-24 20:45:48 +01:00
parent 36a66c59da
commit e66ee7d677
7 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
import {Buffer} from "buffer";
import {bytes} from "./@types/basic";
import {MessageBuffer} from "./xx";
import {MessageBuffer} from "./handshakes/xx";
export const int16BEEncode = (value, target, offset) => {
target = target || Buffer.allocUnsafe(2);

View File

@ -1,7 +1,7 @@
import { Buffer } from "buffer";
import { bytes, bytes32 } from "./@types/basic";
import { NoiseSession, XXHandshake } from "./xx";
import { NoiseSession, XXHandshake } from "./handshakes/xx";
import { KeyPair, PeerId } from "./@types/libp2p";
import {
createHandshakePayload,

0
src/handshakes/ik.ts Normal file
View File

View File

@ -2,9 +2,9 @@ import { Buffer } from 'buffer';
import { AEAD, x25519, HKDF, SHA256 } from 'bcrypto';
import { BN } from 'bn.js';
import { bytes32, uint32, uint64, bytes } from './@types/basic'
import { KeyPair } from './@types/libp2p'
import { generateKeypair } from './utils';
import { bytes32, uint32, uint64, bytes } from '../@types/basic'
import { KeyPair } from '../@types/libp2p'
import { generateKeypair } from '../utils';
export interface MessageBuffer {
ne: bytes32;

View File

View File

@ -1,10 +1,10 @@
import { expect, assert } from "chai";
import { Buffer } from 'buffer';
import { XXHandshake } from "../src/xx";
import { KeyPair } from "../src/@types/libp2p";
import { generateEd25519Keys } from "./utils";
import {createHandshakePayload, generateKeypair, getHandshakePayload} from "../src/utils";
import { XXHandshake } from "../../src/handshakes/xx";
import { KeyPair } from "../../src/@types/libp2p";
import { generateEd25519Keys } from "../utils";
import {createHandshakePayload, generateKeypair, getHandshakePayload} from "../../src/utils";
describe("Index", () => {
const prologue = Buffer.from("/noise", "utf-8");

View File

@ -12,7 +12,7 @@ import {
signPayload
} from "../src/utils";
import { decodeMessageBuffer, encodeMessageBuffer } from "../src/encoder";
import {XXHandshake} from "../src/xx";
import {XXHandshake} from "../src/handshakes/xx";
import {Buffer} from "buffer";
import {getKeyPairFromPeerId, getRandomBuffer} from "./utils";