From ddeb9f190f804327619298a17db4327421d22e65 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 8 Jul 2018 22:29:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Possible=20fix=20to=20decryption?= =?UTF-8?q?=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/decryption/decryptChunk.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ssn/decryption/decryptChunk.ts b/src/ssn/decryption/decryptChunk.ts index 7b7fad0..b733a85 100644 --- a/src/ssn/decryption/decryptChunk.ts +++ b/src/ssn/decryption/decryptChunk.ts @@ -1,3 +1,4 @@ +import int32Mul from './lib/int32Mul'; import updateKeys from './lib/updateKeys'; export default function getDecryptor(decryptionKeys: [number, number, number]) { @@ -12,7 +13,7 @@ export default function getDecryptor(decryptionKeys: [number, number, number]) { //decrypt byte const keyPart = (key2 | 2) & 0xFFFF; - const decryptedByte = (keyPart * (keyPart ^ 1)) >>> 8; + const decryptedByte = int32Mul(keyPart, keyPart ^ 1) >>> 8; curChar = (curChar ^ (decryptedByte & 0xFF)) & 0xFF; //update keys