Handshake payload refactor

This commit is contained in:
morrigan
2019-11-20 21:38:14 +01:00
parent 3519df482d
commit af95dc2fcd
6 changed files with 64 additions and 42 deletions

View File

@ -1,11 +1,4 @@
import protobuf from "protobufjs";
import * as crypto from 'libp2p-crypto';
import { ed25519 } from 'bcrypto';
export async function loadPayloadProto () {
const payloadProtoBuf = await protobuf.load("protos/payload.proto");
return payloadProtoBuf.lookupType("pb.NoiseHandshakePayload");
}
export async function generateEd25519Keys() {
return await crypto.keys.generateKeyPair('ed25519');