mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 18:32:22 +00:00
Remove comment
This commit is contained in:
parent
5be8f61599
commit
d3a652aecb
@ -99,7 +99,8 @@ export async function verifySignedPayload(noiseStaticKey: bytes, plaintext: byte
|
|||||||
}
|
}
|
||||||
|
|
||||||
const generatedPayload = getHandshakePayload(noiseStaticKey);
|
const generatedPayload = getHandshakePayload(noiseStaticKey);
|
||||||
// Unmarshaling from PublicKey protobuf and taking key buffer only.
|
|
||||||
|
// Unmarshaling from PublicKey protobuf
|
||||||
const publicKey = crypto.keys.unmarshalPublicKey(receivedPayload.libp2pKey);
|
const publicKey = crypto.keys.unmarshalPublicKey(receivedPayload.libp2pKey);
|
||||||
if (!publicKey.verify(generatedPayload, receivedPayload.noiseStaticKeySignature)) {
|
if (!publicKey.verify(generatedPayload, receivedPayload.noiseStaticKeySignature)) {
|
||||||
throw new Error("Static key doesn't match to peer that signed payload!");
|
throw new Error("Static key doesn't match to peer that signed payload!");
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import * as crypto from 'libp2p-crypto';
|
import * as crypto from 'libp2p-crypto';
|
||||||
import {KeyPair, PeerId} from "../src/@types/libp2p";
|
import {KeyPair, PeerId} from "../src/@types/libp2p";
|
||||||
import {bytes} from "../src/@types/basic";
|
|
||||||
|
|
||||||
export async function generateEd25519Keys() {
|
export async function generateEd25519Keys() {
|
||||||
return await crypto.keys.generateKeyPair('ed25519');
|
return await crypto.keys.generateKeyPair('ed25519');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user