diff --git a/src/lib/waku_message/version_1.ts b/src/lib/waku_message/version_1.ts index 8016547d74..0749fbb68e 100644 --- a/src/lib/waku_message/version_1.ts +++ b/src/lib/waku_message/version_1.ts @@ -59,7 +59,7 @@ export function clearEncode( envelope = Buffer.concat([envelope, s.signature, Buffer.from([s.recid])]); sig = { signature: Buffer.from(s.signature), - publicKey: secp256k1.publicKeyCreate(sigPrivKey, false), + publicKey: getPublicKey(sigPrivKey), }; } @@ -134,7 +134,7 @@ export function generatePrivateKey(): Uint8Array { * Return the public key for the given private key */ export function getPublicKey(privateKey: Uint8Array | Buffer): Uint8Array { - return ecies.getPublic(Buffer.from(privateKey)); + return secp256k1.publicKeyCreate(privateKey, false); } /**