From 2745783db3b6b050c2cebe426928af7a688e6e7c Mon Sep 17 00:00:00 2001 From: Matija Petrunic Date: Mon, 6 Apr 2020 20:01:38 +0200 Subject: [PATCH] Fix key buffer comparison --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 3c25349..51426fa 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -111,7 +111,7 @@ export function getHkdf(ck: bytes32, ikm: bytes): Hkdf { } export function isValidPublicKey(pk: bytes): boolean { - if(pk.length !== 32 || pk.compare(Buffer.alloc(32))){ + if(pk.length !== 32 || pk.equals(Buffer.alloc(32))){ return false; }