Fix key buffer comparison

This commit is contained in:
Matija Petrunic 2020-04-06 20:01:38 +02:00
parent 99d3c769c9
commit 2745783db3

View File

@ -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;
}