mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-06-13 06:21:39 +00:00
Revert "Replace bcrypto with standalone libraries"
This commit is contained in:
@ -3,8 +3,8 @@ import DuplexPair from 'it-pair/duplex';
|
||||
import {Noise} from "../src";
|
||||
import {createPeerIdsFromFixtures} from "./fixtures/peer";
|
||||
import Wrap from "it-pb-rpc";
|
||||
import {random} from "bcrypto";
|
||||
import sinon from "sinon";
|
||||
import {randomBytes} from 'libp2p-crypto';
|
||||
import {XXHandshake} from "../src/handshake-xx";
|
||||
import {createHandshakePayload, generateKeypair, getHandshakePayload, getPayload, signPayload} from "../src/utils";
|
||||
import {decode0, decode2, encode1, uint16BEDecode, uint16BEEncode} from "../src/encoder";
|
||||
@ -122,7 +122,7 @@ describe("Noise", () => {
|
||||
const wrappedInbound = Wrap(inbound.conn);
|
||||
const wrappedOutbound = Wrap(outbound.conn);
|
||||
|
||||
const largePlaintext = randomBytes(100000);
|
||||
const largePlaintext = random.randomBytes(100000);
|
||||
wrappedOutbound.writeLP(largePlaintext);
|
||||
const response = await wrappedInbound.read(100000);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import {keys} from 'libp2p-crypto';
|
||||
import * as crypto from 'libp2p-crypto';
|
||||
import {KeyPair, PeerId} from "../src/@types/libp2p";
|
||||
|
||||
export async function generateEd25519Keys() {
|
||||
return await keys.generateKeyPair('ed25519');
|
||||
return await crypto.keys.generateKeyPair('ed25519');
|
||||
}
|
||||
|
||||
export function getKeyPairFromPeerId(peerId: PeerId): KeyPair {
|
||||
|
Reference in New Issue
Block a user