diff --git a/src/utils.ts b/src/utils.ts index 4a3b267..08b8cea 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -99,7 +99,8 @@ export async function verifySignedPayload(noiseStaticKey: bytes, plaintext: byte } const generatedPayload = getHandshakePayload(noiseStaticKey); - // Unmarshaling from PublicKey protobuf and taking key buffer only. + + // Unmarshaling from PublicKey protobuf const publicKey = crypto.keys.unmarshalPublicKey(receivedPayload.libp2pKey); if (!publicKey.verify(generatedPayload, receivedPayload.noiseStaticKeySignature)) { throw new Error("Static key doesn't match to peer that signed payload!"); diff --git a/test/utils.ts b/test/utils.ts index 5e8b430..2ac5b7b 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -1,6 +1,5 @@ import * as crypto from 'libp2p-crypto'; import {KeyPair, PeerId} from "../src/@types/libp2p"; -import {bytes} from "../src/@types/basic"; export async function generateEd25519Keys() { return await crypto.keys.generateKeyPair('ed25519');