From 936e103c3f36acb697404b4bca4cf2607f3c79e5 Mon Sep 17 00:00:00 2001 From: nanov Date: Tue, 30 Mar 2021 14:50:32 +0300 Subject: [PATCH] fix: crypto check --- lib/crypto/Crypto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crypto/Crypto.js b/lib/crypto/Crypto.js index 6fd612e..1cefdac 100644 --- a/lib/crypto/Crypto.js +++ b/lib/crypto/Crypto.js @@ -72,7 +72,7 @@ module.exports = class Crypto { const mod = new BigNumber(key.n()); const buffer = modPow(base, power, mod).toBEBuffer(); - if (buffer.byteLength !== 257 && buffer[0] === 0x00) + if (buffer.byteLength === 257 && buffer[0] === 0x00) return buffer.slice(1).toString('base64'); return buffer.toString('base64');