mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-06-18 21:41:42 +00:00
Expose noise class
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import protobuf from "protobufjs";
|
||||
import * as crypto from 'libp2p-crypto';
|
||||
import { ed25519 } from 'bcrypto';
|
||||
import { bytes } from "../src/types/basic";
|
||||
|
||||
export async function loadPayloadProto () {
|
||||
const payloadProtoBuf = await protobuf.load("protos/payload.proto");
|
||||
@ -9,3 +11,9 @@ export async function loadPayloadProto () {
|
||||
export async function generateEd25519Keys() {
|
||||
return await crypto.keys.generateKeyPair('ed25519');
|
||||
}
|
||||
|
||||
export async function signPayload(privateKey: bytes, payload: bytes) {
|
||||
const Ed25519PrivateKey = crypto.keys.supportedKeys.ed25519.Ed25519PrivateKey;
|
||||
// const ed25519 = Ed25519PrivateKey(privateKey, "need-to-get-public-key");
|
||||
// return ed25519.sign(privateKey, payload);
|
||||
}
|
||||
|
Reference in New Issue
Block a user