🚧 Possible fix to decryption errors

This commit is contained in:
C-3PO 2018-07-08 22:29:03 +02:00
parent f14be006be
commit ddeb9f190f
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

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